Network topology graph generation method, device, equipment and storage medium
By generating MAC address cache sequences and PhyMAC address sequences of network nodes, the connection relationships are automatically determined and a topology map is drawn, solving the problem of low efficiency in manual drawing and improving the efficiency and accuracy of network topology map drawing.
Patent Information
- Application Number
- CN202210169341.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-22
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-02-22
AI Technical Summary
In existing technologies, updating enterprise network topology maps relies on manual drawing, which leads to low efficiency, especially when network nodes change.
By obtaining the physical addresses of network nodes, a MAC address cache sequence and a PhyMAC address sequence are generated. The matching relationship between the two is determined, the connection relationship between network nodes is determined based on the matching relationship, and a network topology map is automatically drawn.
It enables automatic drawing of network topology diagrams, improving drawing efficiency and accuracy while saving manpower and time.
Smart Images

Figure CN116684293B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of network communication, and in particular to a network topology graph generation method and device, equipment and a storage medium. BACKGROUND
[0002] The network topology graph refers to the physical layout of various devices interconnected by transmission media, that is, what way to connect the computers and other devices in the network, and the topology graph can give the network configuration of the network server and workstation and the connection therebetween. At present, the network topology graph of an enterprise is mainly drawn by manual work. In the face of a large number of network nodes, if the network nodes change, the network topology graph needs to be updated manually, resulting in low efficiency of updating the network topology graph. SUMMARY
[0003] The embodiments of the present application provide a network topology graph generation method, device, equipment and storage medium, aiming at solving the technical problem of low efficiency of manually drawing the network topology graph of the network node.
[0004] The embodiments of the present application provide a network topology graph generation method, which comprises:
[0005] Obtaining the node physical address corresponding to each network node, generating a MAC address cache sequence and a PhyMAC address sequence according to the node physical address;
[0006] Determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence;
[0007] Determining the connection relationship between each network node according to the matching relationship; and
[0008] Drawing the network topology graph corresponding to each network node according to the connection relationship.
[0009] In an embodiment, the step of generating the MAC address cache sequence and the PhyMAC address sequence according to the node physical address comprises:
[0010] Determining the valid physical address in the node physical address, wherein the valid physical address is the physical address in the node physical address which is different from the preset physical address;
[0011] Generating the MAC address cache sequence and the PhyMAC address sequence according to the valid physical address.
[0012] In an embodiment, the step of determining the matching relationship between the first physical address included in the MAC address cache sequence and the second physical address included in the PhyMAC address sequence comprises:
[0013] acquiring the number of interfaces of each of the network nodes;
[0014] determining the second physical address of the number of interfaces matched with each of the first physical addresses;
[0015] generating the matching relationship according to each of the first physical addresses and the second physical address of the number of interfaces.
[0016] In an embodiment, the step of drawing the network topology graph corresponding to each of the network nodes according to the connection relationship comprises:
[0017] determining the data group corresponding to each of the network nodes by using an exhaustive algorithm according to the connection relationship and the IP address corresponding to each of the network nodes;
[0018] determining the root network node, the child network node and the leaf network node according to each of the data groups;
[0019] generating the network topology graph based on the root network node, the child network node and the leaf network node.
[0020] In an embodiment, after the step of drawing the network topology graph corresponding to each of the network nodes according to the connection relationship, the method further comprises:
[0021] detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal;
[0022] when the communication between the two network nodes connected in each physical link in the network topology graph is normal, displaying the network topology graph.
[0023] In an embodiment, after the step of detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal, the method further comprises:
[0024] when the communication between the two network nodes connected in at least one physical link in the network topology graph is not normal, displaying the alarm information of the network node with abnormal communication.
[0025] In an embodiment, the step of detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal comprises:
[0026] performing forward communication detection and reverse communication detection on two network nodes connected in each physical link existing in the network topology graph;
[0027] when the first detection result of the forward communication detection and the second detection result of the reverse communication detection both satisfy the connectivity condition, determining that communication between the two network nodes connected in the detected physical link is normal;
[0028] when any one of the first detection result and the second detection result does not satisfy the connectivity condition, determining that communication between the two network nodes connected in the detected physical link is abnormal.
[0029] In addition, to achieve the above object, the present application further provides a network topology graph generation device, comprising:
[0030] an address acquisition module configured to acquire node physical addresses corresponding to each network node, generate a MAC address cache sequence and a PhyMAC address sequence according to the node physical addresses;
[0031] an address matching module configured to determine a matching relationship between a first physical address included in the MAC address cache sequence and a second physical address included in the PhyMAC address sequence;
[0032] a relationship determination module configured to determine a connection relationship between each network node according to the matching relationship;
[0033] a topology drawing module configured to draw a network topology graph corresponding to each network node according to the connection relationship.
[0034] In addition, to achieve the above object, the present application further provides a detection device, comprising a memory, a processor, and a network topology graph generation program stored in the memory and executable on the processor, wherein the network topology graph generation program, when executed by the processor, implements the steps of the network topology graph generation method.
[0035] In addition, to achieve the above object, the present application further provides a storage medium having a network topology graph generation program stored thereon, wherein the network topology graph generation program, when executed by a processor, implements the steps of the network topology graph generation method.
[0036] The network topology graph generation method, device, equipment and storage medium provided in the embodiments of the present application have at least the following technical effects or advantages:
[0037] The technical scheme of the application comprises the following steps: obtaining the node physical address corresponding to each network node, generating a MAC address cache sequence and a PhyMAC address sequence according to the node physical address, determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence, determining the connection relationship between each network node according to the matching relationship, and drawing the network topology graph corresponding to each network node according to the connection relationship. BRIEF DESCRIPTION OF DRAWINGS
[0038] Figure 1 The structural schematic diagram of the hardware running environment related to the embodiment scheme of the application;
[0039] Figure 2 The flow schematic diagram of the embodiment of the network topology graph generation method of the application;
[0040] Figure 3 The schematic diagram of the MAC address cache sequence and the PhyMAC address sequence matching of the application;
[0041] Figure 4 The schematic diagram of the generation process of the MAC address cache sequence and the PhyMAC address sequence in the network topology graph generation method of the application;
[0042] Figure 5 The specific flow schematic diagram of the step S240 of the network topology graph generation method of the application;
[0043] Figure 6 The flow schematic diagram of the Node connection data grouping of the application;
[0044] Figure 7 The schematic diagram of the two-layer MAC transparent data model of the application;
[0045] Figure 8 The schematic diagram of the network topology graph of the application;
[0046] Figure 9 The flow schematic diagram of another embodiment of the network topology graph generation method of the application;
[0047] Figure 10 The functional module diagram of the network topology graph generation device of the application. DETAILED DESCRIPTION
[0048] For a better understanding of the above technical solutions, the exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present application can be more thoroughly understood and the scope of the present application can be accurately conveyed to those skilled in the art.
[0049] As an implementation manner, the network topology graph generation device can be implemented as shown in Figure 1 The network topology graph generation device includes a processor 1001, such as a CPU, a memory 1002, and a communication bus 1003. The communication bus 1003 is used to realize the connection and communication between the components.
[0050] The memory 1002 can be a high-speed RAM memory or a stable memory (non-volatile XeXory), such as a disk memory. As shown in Figure 1 The memory 1002 as a storage medium can include a network topology graph generation program; and the processor 1001 can be used to call the network topology graph generation program stored in the memory 1002 and perform the following operations:
[0051] Obtain the node physical address corresponding to each network node, generate a MAC address cache sequence and a PhyMAC address sequence according to the node physical address;
[0052] Determine the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence;
[0053] Determine the connection relationship between each of the network nodes according to the matching relationship; and,
[0054] Draw the network topology graph corresponding to each of the network nodes according to the connection relationship.
[0055] Further, the processor 1001 can be used to call the network topology graph generation program stored in the memory 1002 and perform the following operations:
[0056] Determine the valid physical address in the node physical address, wherein the valid physical address is the physical address in the node physical address which is different from the preset physical address;
[0057] Generate the MAC address cache sequence and the PhyMAC address sequence according to the valid physical address.
[0058] Further, the processor 1001 can be configured to invoke a network topology graph generation program stored in the memory 1002, and perform the following operations:
[0059] Obtain the number of interfaces of each network node;
[0060] Determine the second physical address matching the number of interfaces of each first physical address;
[0061] Generate the matching relationship according to each first physical address and the second physical address of the number of interfaces.
[0062] Further, the processor 1001 can be configured to invoke a network topology graph generation program stored in the memory 1002, and perform the following operations:
[0063] According to the connection relationship and the IP address corresponding to each network node, determine the data group corresponding to each network node by using an exhaustive algorithm;
[0064] Determine the root network node, the child network node and the leaf network node according to each data group;
[0065] Generate the network topology graph based on the root network node, the child network node and the leaf network node.
[0066] Further, the processor 1001 can be configured to invoke a network topology graph generation program stored in the memory 1002, and perform the following operations:
[0067] Detect whether the communication between the two network nodes connected in each physical link in the network topology graph is normal;
[0068] When the communication between the two network nodes connected in each physical link in the network topology graph is normal, display the network topology graph.
[0069] Further, the processor 1001 can be configured to invoke a network topology graph generation program stored in the memory 1002, and perform the following operations:
[0070] When the communication between the two network nodes connected in at least one physical link in the network topology graph is not normal, display the alarm information of the network node with abnormal communication.
[0071] Further, the processor 1001 can be configured to invoke a network topology graph generation program stored in the memory 1002, and perform the following operations:
[0072] Perform forward communication detection and reverse communication detection on the two network nodes connected in each physical link in the network topology graph.
[0073] when both the first detection result of the forward communication detection and the second detection result of the reverse communication detection satisfy the connectivity condition, determining that the communication between the two network nodes connected in the detected physical link is normal;
[0074] when either the first detection result or the second detection result does not satisfy the connectivity condition, determining that the communication between the two network nodes connected in the detected physical link is abnormal.
[0075] Embodiments of the network topology graph generation method provided by the present application are described in detail below with reference to the accompanying drawings. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0076] As shown in FIG. 1, in an embodiment of the present application, the network topology graph generation method of the present application comprises the following steps: Figure 2
[0077] Step S210: Obtain the node physical address corresponding to each network node, and generate a MAC address cache sequence and a PhyMAC address sequence according to the node physical address.
[0078] In this embodiment, the network node refers to a network device, such as a router, a switch, etc.; the node physical address refers to the MAC address of the network device, also known as the physical address. After connecting each network device to complete the network topology construction, the network topology graph corresponding to each network device needs to be drawn based on actual requirements, so as to detect the connection relationship of each network device and the communication condition between each network device based on the network topology graph.
[0079] Specifically, the data stream of each network node is collected by setting a probe, for example, the probe can be set on a switch, and the node physical address corresponding to each network node is extracted from the data stream collected by the probe. After obtaining the node physical address corresponding to each network node, the node physical address corresponding to each network node and the node physical address corresponding to other network nodes connected by each network node can be determined, and then the MAC address cache sequence is generated according to the node physical address corresponding to each network node, the node physical address corresponding to each network node in the MAC address cache sequence, that is, the MAC address corresponding to each network node, which is referred to as the first physical address here; the PhyMAC address sequence is generated according to the node physical address corresponding to other network nodes connected by each network node, and the node physical address corresponding to other network nodes in the PhyMAC address sequence is referred to as the second physical address here; wherein the other network nodes have multiple, the MAC address cache sequence and the PhyMAC address sequence are as shown in Figure 3
[0080] Step S220: determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence.
[0081] The breadth-first forward matching method is used to match the multiple second physical addresses in the PhyMAC address sequence corresponding to each first physical address in the MAC address cache sequence, so as to obtain the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence. As shown in Figure 3 mac1 in the MAC address cache sequence matches phymac1, phymac2, phymac3, phymac4, phymac... in the PhyMAC address sequence, so mac1 and phymac1, phymac2, phymac3, phymac4, phymac... in the PhyMAC address sequence have a matching relationship.
[0082] Further, step S220 includes the following steps:
[0083] Obtaining the number of interfaces of each network node;
[0084] Determining the second physical address of the number of interfaces matched with each first physical address;
[0085] Generating the matching relationship according to each first physical address and the second physical address of the number of interfaces.
[0086] Each network node has one or more interfaces, and the number of interfaces of each network node is known. Each network node is connected to one or more other network nodes via its own interface. Therefore, the PhyMAC address sequence contains second physical addresses corresponding to the number of interfaces that match each first physical address, and the matching relationship is generated based on each first physical address and the number of interfaces that match each first physical address.
[0087] Step S230: Determine the connection relationship between each of the network nodes according to the matching relationship.
[0088] Furthermore, each network node has a unique MAC address. Once the matching relationship between the first physical address and the second physical address is determined, the connection relationship between the network nodes can also be determined, that is, the connection relationship between the network nodes is represented by the matching relationship.
[0089] Step S240: Draw a network topology diagram corresponding to each of the network nodes according to the connection relationship.
[0090] After obtaining the connection relationship between each network node, it can be determined which network devices any network device is connected to, and then the network topology corresponding to each network node can be drawn based on the connection relationship. Figure 8 As shown, Figure 8 A network topology diagram. Figure 8 Where a, b, c, d, e, and f represent a network node respectively.
[0091] According to the above technical solution, this embodiment adopts a technical solution of obtaining the node physical address corresponding to each network node, generating a MAC address cache sequence and a PhyMAC address sequence based on the node physical address, determining a matching relationship between a first physical address included in the MAC address cache sequence and a second physical address included in the PhyMAC address sequence, determining a connection relationship between each network node based on the matching relationship, and drawing a network topology corresponding to each network node based on the connection relationship. This achieves automatic drawing of a network topology, improves the efficiency and accuracy of network topology drawing, and saves manpower and time.
[0092] like Figure 4 As shown, based on the above embodiment, the generation of the MAC address cache sequence and the PhyMAC address sequence includes the following steps:
[0093] Step S211: determining a valid physical address among the node physical addresses;
[0094] Step S212: generating the MAC address cache sequence and the PhyMAC address sequence according to the effective physical address.
[0095] The effective physical address is a physical address in the node physical address which is different from the preset physical address. Specifically, servers, monitoring devices, and the like do not participate in network topology drawing, that is, the nodes in the network topology diagram include servers, monitoring devices, and the like. Based on this, after obtaining the node physical address corresponding to each network node, the node physical address obtained includes the physical address of the servers, monitoring devices, and the like, which is referred to as the preset physical address here, and can also be understood as an invalid physical address.
[0096] Further, the preset physical address in the obtained node physical address is filtered, that is, the physical address of the servers, monitoring devices, and the like is filtered out from the obtained node physical address. Among them, the filtering process is to judge whether the physical address contained in the obtained node physical address is the same as the preset physical address. If the obtained node physical address contains a physical address which is the same as the preset physical address, it is filtered out. The physical address remaining in the obtained node physical address is the effective physical address. In this way, by filtering the preset physical address in the obtained node physical address, the amount of calculation can be reduced, which is conducive to improving the drawing efficiency of the network topology diagram.
[0097] Further, the MAC address cache sequence and the PhyMAC address sequence are generated according to the effective physical address, that is, after obtaining the effective physical address, the physical address corresponding to each network node and the physical address corresponding to other network nodes connected by each network node can be determined. Then, the MAC address cache sequence is generated according to the physical address corresponding to each network node, and the PhyMAC address sequence is generated according to the physical address corresponding to other network nodes connected by each network node. The MAC address cache sequence and the PhyMAC address sequence are as shown in Figure 3
[0098] As shown in Figure 5 based on the above embodiment, step S240 includes the following steps:
[0099] Step S241: determining the data group corresponding to each network node by using an exhaustive algorithm according to the connection relationship and the IP address corresponding to each network node.
[0100] After determining the connection relationship between each network node, the node connection data corresponding to each network node in the connection relationship can be found, that is, Figure 3 Node connection data in the table. The Node connection data includes IP address, device port name (portname) and MAC address (macaddress) corresponding to each network node and IP address, device port name (portname) and MAC address (macaddress) of other network nodes corresponding to each network node, and the Node connection data is written in the Mysql transfer table. For example, the Node connection data includes:
[0101] Node a ip, Node a portname, Node a macaddress;
[0102] Node b ip, Node b portname, Node b macaddress.
[0103] In the network topology, due to the characteristics of the layer 2 broadcast, the MAC address will be transmitted through the layer 2 network to the broadcast domain, resulting in the fact that the data matched in the forward direction will inevitably have the case that a single source port corresponds to multiple target ports, so it is necessary to identify the data matched in one-to-many, group based on the association of the Node connection data, and each group corresponds to a network device containing all the network devices in the broadcast domain.
[0104] Specifically, according to the connection relationship and the IP address corresponding to each network node, the data groups corresponding to each network node are determined by using the exhaustive algorithm, that is, the IP address corresponding to each network node and the IP address of other network nodes corresponding to each network node are grouped based on the exhaustive algorithm, to obtain a plurality of data groups with broadcast domain association, and the plurality of data groups are as shown in Figure 6 , such as [node A ip 1, node B ip 2], [node A ip 1, node B ip 2, nodeA ip 2, node B ip 2] and the like.
[0105] Step S242: determining root network nodes, child network nodes and leaf network nodes according to each of the data groups.
[0106] Step S243: generating the network topology graph based on the root network nodes, the child network nodes and the leaf network nodes.
[0107] After obtaining a plurality of data groups, a layer 2 MAC transmission data model can be generated, and the layer 2 MAC transmission data model is a mesh data structure intersecting with each other, as shown in Figure 7 Figure 7 a, b, c, d, e, f in the figure respectively represent a network node. The root node, the child node and the leaf node of the network topology graph are determined from the two-layer MAC transparent data model based on the connection relationship, and the root node, the child node and the leaf node are respectively referred to as a root network node, a child network node and a leaf network node. Assuming that the root network node of the network topology graph determined from the two-layer MAC transparent data model based on the connection relationship is a, the child network nodes are b, c, d, e and f, and the leaf network nodes are (c, d, e, f), (b, d, e, f), (b, c, e, f), (b, c, d, f) and (b, c, d, e). Among them, the child network nodes b, c, d, e and f are the child nodes of a; for the child network nodes b, c, d, e and f, (c, d, e, f) are the child nodes of b respectively, (b, d, e, f) are the child nodes of c respectively, (b, c, e, f) are the child nodes of d respectively, (b, c, d, f) are the child nodes of e respectively, and (b, c, d, e) are the child nodes of f respectively.
[0108] After obtaining the root network node, the child network node and the leaf network node of the network topology graph, the root network node, the child network node and the leaf network node are connected based on the connection relationship, so as to realize the network topology graph. As shown in the figure, Figure 8 the tree structure in the figure is the network topology graph, Figure 8 a, b, c, d, e, f in the figure respectively represent a network node, and a is a root network node.
[0109] As shown in the figure, Figure 9 in another embodiment of the present application, the network topology graph generation method of the present application comprises the following steps:
[0110] Step S210: obtaining the node physical address corresponding to each network node, generating a MAC address cache sequence and a PhyMAC address sequence according to the node physical address;
[0111] Step S220: determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence;
[0112] Step S230: determining the connection relationship between each network node according to the matching relationship;
[0113] Step S240: drawing the network topology graph corresponding to each network node according to the connection relationship;
[0114] Step S251: detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal;
[0115] Step S252: displaying the network topology graph when the two network nodes connected in each physical link existing in the network topology graph are in normal communication;
[0116] Step S253: displaying the alarm information of the network nodes in abnormal communication when the two network nodes connected in at least one physical link existing in the network topology graph are in abnormal communication.
[0117] The specific implementation of steps S210-S240 of the embodiment is the same as that of steps S210-S240 of the above-described embodiment, and thus will not be described again.
[0118] Specifically, after the network topology graph is drawn, the network topology graph needs to be displayed. The condition for displaying the network topology graph is that the network nodes in the network topology graph are in normal communication. Based on this, each physical link in the network topology graph is determined first, as shown in the following table: Figure 8 The forward query is from a to any network node, and the reverse query is from b, or c, or d, or e, or f to any network node. Each forward query is followed by a reverse query. Assuming that the forward query from a to b is ab, and bc≠ac and ab≠ac, ab and ac can be obtained as physical links. The determination of all physical links in the network topology graph is completed by successive investigation. Each physical link connects two network nodes, for example, the physical link ab connects the network node a and the network node b.
[0119] Further, whether the two network nodes connected in each physical link are in normal communication is detected, and the detection specifically includes:
[0120] The two network nodes connected in each physical link existing in the network topology graph are subjected to forward communication detection and reverse communication detection;
[0121] When the first detection result of the forward communication detection and the second detection result of the reverse communication detection both satisfy the connectivity condition, it is determined that the two network nodes connected in the detected physical link are in normal communication;
[0122] When any one of the first detection result and the second detection result does not satisfy the connectivity condition, it is determined that the two network nodes connected in the detected physical link are in abnormal communication.
[0123] The forward communication detection refers to sending detection information from the first network node to the second network node connected by the physical link according to the set direction, and the reverse communication detection refers to sending detection information from the second network node to the first network node connected by the physical link according to the direction opposite to the set direction. The sending of the detection information from the first network node to the second network node connected by the physical link according to the set direction is the first detection result, and the sending of the detection information from the second network node to the first network node connected by the physical link according to the direction opposite to the set direction is the second detection result. The first network node receives the detection information sent by the first network node or the second network node does not receive the detection information sent by the first network node, the second detection result is that the first network node receives the detection information sent by the second network node or the first network node does not receive the detection information sent by the second network node, and the connection condition includes that the second network node receives the detection information sent by the first network node and the first network node receives the detection information sent by the second network node. If the first detection result and the second detection result satisfy the connection condition, it is determined that the communication between the two network nodes connected by the physical link in the detected physical link is normal; if any one of the first detection result and the second detection result does not satisfy the connection condition, it is determined that the communication between the two network nodes connected by the physical link in the detected physical link is abnormal. The first network node and the second network node are two network nodes connected by the same physical link.
[0124] If the communication between the two network nodes connected by each physical link in the network topology graph is normal, it indicates that the communication between the network nodes in the network topology graph is normal, and the network topology graph is displayed. Through the displayed network topology graph, the connection of the actually connected network nodes can be checked, and if the network nodes in the network topology are manually added or reduced, the new network topology after the network nodes are added or reduced can be reflected through the drawn network topology graph.
[0125] If the communication between the two network nodes connected by at least one physical link in the network topology graph is abnormal, it indicates that a network node in the network topology graph fails, and alarm information of the network node with abnormal communication is displayed. The alarm information includes a failed network node identifier, position information, and a failure reminder, and the like. The alarm information can be used to quickly find the failed network node by a person, so that the failed network node can be repaired or replaced, and the accurate positioning and alarm of the failed network node can be realized.
[0126] As shown in Figure 10 The network topology graph generation device provided by the application comprises:
[0127] The address obtaining module 310 is configured to obtain node physical addresses corresponding to the network nodes, and generate a MAC address cache sequence and a PhyMAC address sequence according to the node physical addresses.
[0128] The address matching module 320 is configured to determine a matching relationship between a first physical address included in the MAC address cache sequence and a second physical address included in the PhyMAC address sequence.
[0129] The relationship determining module 330 is configured to determine a connection relationship between the network nodes according to the matching relationship.
[0130] The topology mapping module 340 is configured to map a network topology graph corresponding to the network nodes according to the connection relationship.
[0131] Further, the address obtaining module 310 includes, in the aspect of generating the MAC address cache sequence and the PhyMAC address sequence according to the node physical addresses, the following steps.
[0132] The address filtering unit is configured to determine valid physical addresses in the node physical addresses, wherein the valid physical addresses are physical addresses different from preset physical addresses in the node physical addresses.
[0133] The list generating unit is configured to generate the MAC address cache sequence and the PhyMAC address sequence according to the valid physical addresses.
[0134] Further, the address matching module 320 includes the following steps.
[0135] The number obtaining unit is configured to obtain a number of interfaces of each network node.
[0136] The address matching unit is configured to determine the second physical addresses of the number of interfaces matched with each first physical address.
[0137] The relationship generating unit is configured to generate the matching relationship according to each first physical address and the second physical address of the number of interfaces.
[0138] Further, the topology mapping module 340 includes the following steps.
[0139] The information grouping unit is configured to determine data groups corresponding to each network node by using an exhaustive algorithm according to the connection relationship and IP addresses corresponding to each network node.
[0140] The node determining unit is configured to determine a root network node, a child network node and a leaf network node according to each data group.
[0141] a topology mapping unit, configured to generate the network topology map based on the root network node, the sub-network node and the leaf network node.
[0142] Further, the network topology map generation apparatus further comprises:
[0143] a communication detection unit, configured to detect whether communication between two network nodes connected in each physical link in the network topology map is normal;
[0144] a topology display unit, configured to display the network topology map when communication between two network nodes connected in each physical link in the network topology map is normal.
[0145] Further, the network topology map generation apparatus further comprises:
[0146] a fault alarm unit, configured to display alarm information of the network node with abnormal communication when communication between two network nodes connected in at least one physical link in the network topology map is abnormal.
[0147] Further, the communication detection unit comprises:
[0148] a test sub-unit, configured to perform forward communication detection and reverse communication detection on two network nodes connected in each physical link in the network topology map;
[0149] a first judgment sub-unit, configured to determine that communication between two network nodes connected in the detected physical link is normal when the first detection result of the forward communication detection and the second detection result of the reverse communication detection both satisfy a connectivity condition;
[0150] a second judgment sub-unit, configured to determine that communication between two network nodes connected in the detected physical link is abnormal when any one of the first detection result and the second detection result does not satisfy the connectivity condition.
[0151] The specific implementation of the network topology map generation apparatus of the present application is basically the same as that of the network topology map generation method, and thus will not be described here.
[0152] Further, the present application further provides a detection device, which comprises a memory, a processor and a network topology map generation program stored in the memory and executable on the processor, and the network topology map generation program implements the steps of the network topology map generation method when executed by the processor.
[0153] Further, the present application also provides a storage medium, which has a network topology graph generation program stored thereon, wherein the network topology graph generation program, when executed by a processor, implements the steps of the network topology graph generation method.
[0154] Those skilled in the art will appreciate that embodiments of the present application can be supplied as methods, systems, or computer program products. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code.
[0155] The present application is described in reference to the flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing system or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the function specified by the flowchart illustrations and / or block diagrams block or blocks.
[0156] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the function specified by the flowchart illustrations and / or block diagrams block or blocks.
[0157] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flowchart illustrations and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams block or blocks. Figure 1 means for performing the function specified by the flowchart illustrations and / or block diagrams block or blocks.
[0158] It should be noted that the word "comprising" does not exclude the presence of elements or steps other than those listed in a claim. The word "a" or "an" preceding the citation of elements does not exclude the presence of a plurality of such elements. It is further noted that the claims can be drafted to exclude any optional element. A combination of claims does not require every element of one claim to be included in the combination for the combination to be within the scope of the disclosure. The word "first", "second", "third" etc. does not necessarily indicate any order, quantity, or position but is used to indicate different categories. The use of the terms "first", "second", "third" etc. does not require that the corresponding elements be in any order, quantity, or position.
[0159] Although the preferred embodiments of the application have been described, those skilled in the art will recognize that many modifications and variations of the preferred embodiments could be made without departing from the spirit or scope of the application. Accordingly, it is intended that there be included within the scope of the application, all such modifications and variations as can be reasonably inferred from the disclosure herein.
[0160] It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A network topology map generation method, characterized by, The network topology graph generation method comprises: obtaining the node physical addresses corresponding to each network node, and generating a MAC address cache sequence and a PhyMAC address sequence according to the node physical addresses, wherein the MAC address cache sequence is generated according to the node physical addresses corresponding to each network node, and the PhyMAC address sequence is generated according to the node physical addresses corresponding to other network nodes connected to each network node; determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence; determining the connection relationship between each network node according to the matching relationship; and determining the node connection data corresponding to each network node in the connection relationship, wherein the node connection data comprises the IP address corresponding to each network node and the IP addresses of other network nodes connected to each network node; grouping the IP address corresponding to each network node and the IP addresses of other network nodes connected to each network node based on an exhaustive algorithm to obtain data groups with broadcast domain association; determining root network nodes, child network nodes and leaf network nodes according to each data group; generating a network topology graph based on the root network nodes, the child network nodes and the leaf network nodes.
2. The method of claim 1, wherein, The step of generating a MAC address cache sequence and a PhyMAC address sequence according to the node physical addresses comprises: determining valid physical addresses in the node physical addresses, wherein the valid physical addresses are physical addresses different from preset physical addresses in the node physical addresses; generating the MAC address cache sequence and the PhyMAC address sequence according to the valid physical addresses.
3. The method of claim 1, wherein, The step of determining the matching relationship between the first physical address contained in the MAC address cache sequence and the second physical address contained in the PhyMAC address sequence comprises: obtaining the number of interfaces of each network node; determining the second physical addresses matched with the number of interfaces of each first physical address; generating the matching relationship according to each first physical address and the second physical address of the number of interfaces.
4. The method of claim 1, wherein, After the step of generating a network topology graph based on the root network nodes, the child network nodes and the leaf network nodes, the method further comprises: detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal; when the communication between the two network nodes connected in each physical link existing in the network topology graph is normal, displaying the network topology graph.
5. The method of claim 4, wherein, After the step of detecting whether the communication between the two network nodes connected in each physical link in the network topology graph is normal, the method further comprises: when the communication between the two network nodes connected in at least one physical link in the network topology graph is not normal, displaying the alarm information of the network nodes with abnormal communication.
6. The method of claim 5, wherein, The step of detecting whether communication between the two network nodes connected in each physical link in the network topology graph is normal comprises: forward communication detection and reverse communication detection are performed on the two network nodes connected in each physical link in the network topology graph; when the first detection result of the forward communication detection and the second detection result of the reverse communication detection both satisfy a connectivity condition, it is determined that communication between the two network nodes connected in the detected physical link is normal; when either the first detection result or the second detection result does not satisfy the connectivity condition, it is determined that communication between the two network nodes connected in the detected physical link is abnormal.
7. A network topology map generation apparatus characterized by comprising: The network topology graph generation apparatus comprises: an address acquisition module configured to acquire node physical addresses corresponding to each network node, generate a MAC address cache sequence and a PhyMAC address sequence based on the node physical addresses, wherein the MAC address cache sequence is generated based on the node physical addresses corresponding to each network node, and the PhyMAC address sequence is generated based on node physical addresses corresponding to other network nodes connected to each network node; an address matching module configured to determine a matching relationship between a first physical address included in the MAC address cache sequence and a second physical address included in the PhyMAC address sequence; a relationship determination module configured to determine a connection relationship between each network node based on the matching relationship; a topology drawing module configured to determine node connection data corresponding to each network node in the connection relationship, wherein the node connection data comprises an IP address corresponding to each network node and IP addresses of other network nodes connected to each network node, group the IP address corresponding to each network node and the IP addresses of other network nodes connected to each network node based on an exhaustive algorithm to obtain data groups having broadcast domain association, determine a root network node, a child network node and a leaf network node based on each data group, and generate a network topology graph based on the root network node, the child network node and the leaf network node.
8. A detection device, characterized by The detection device comprises a memory, a processor, and a network topology graph generation program stored on the memory and executable on the processor, and the network topology graph generation program, when executed by the processor, implements the steps of the network topology graph generation method according to any one of claims 1-6.
9. A storage medium, characterized by A computer readable storage medium having stored thereon a network topology graph generation program, and the network topology graph generation program, when executed by a processor, implements the steps of the network topology graph generation method according to any one of claims 1-6.
Citation Information
Patent Citations
Network topology structure generation method and device, equipment and medium
CN111600762A
Ethernet switch topology generating and drawing method based on Tarjan algorithm
CN113300880A