CN112600689A - Network topology generation method and device and computer equipment - Google Patents

Network topology generation method and device and computer equipment Download PDF

Info

Publication number
CN112600689A
CN112600689A CN202011385009.0A CN202011385009A CN112600689A CN 112600689 A CN112600689 A CN 112600689A CN 202011385009 A CN202011385009 A CN 202011385009A CN 112600689 A CN112600689 A CN 112600689A
Authority
CN
China
Prior art keywords
information
network
router
lldp
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011385009.0A
Other languages
Chinese (zh)
Inventor
杨韶东
张丹丹
苗海峰
吕益行
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dawning Information Industry Beijing Co Ltd
Dawning Information Industry Co Ltd
Original Assignee
Dawning Information Industry Beijing Co Ltd
Dawning Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dawning Information Industry Beijing Co Ltd, Dawning Information Industry Co Ltd filed Critical Dawning Information Industry Beijing Co Ltd
Priority to CN202011385009.0A priority Critical patent/CN112600689A/en
Publication of CN112600689A publication Critical patent/CN112600689A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Landscapes

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

Abstract

The invention discloses a network topology generation method, a network topology generation device and computer equipment. The network topology generation method comprises the following steps: receiving Link Layer Discovery Protocol (LLDP) information sent by routers in a plurality of network segments at regular time, wherein each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segments where the routers are located; preprocessing the LLDP information and generating an information linked list; processing the information in the information linked list by utilizing a network segment topology generation algorithm, and generating a network segment topology map; and integrating the network segment topological graph by using a network topology generation algorithm to generate a network topological graph. According to the network topology generation method, the network topology generation device and the computer equipment, the LLDP information sent by the routers in the network segments at regular time is received, the network segment topological graph is generated by using the network segment topological generation algorithm, and the network topological graph is generated by using the network topological generation algorithm, so that resources can be saved, and the working efficiency can be improved.

Description

Network topology generation method and device and computer equipment
Technical Field
The present invention relates to the field of computer network technologies, and in particular, to a network topology generation method and apparatus, and a computer device.
Background
With the advent of the information age, the reliability of computer network operation is of paramount importance, and higher requirements are placed on network management. The main purpose of network topology generation is to acquire and maintain the existence information of network nodes and the connection relationship information between the network nodes, and draw a whole network topology graph on the basis of the existence information and the connection relationship information. And the network management personnel quickly position the fault node on the basis of the topological graph. Existing topology generation algorithms can be mainly classified into three categories: a network topology generation method based on SNMP (simple network management protocol), a network topology generation method based on a general protocol, and a network topology generation method based on a routing protocol. Most of the current topology generation methods are based on the SNMP protocol, that is, the network management workstation sends a query message to the managed device, and the managed device responds after receiving the message. Therefore, the network management workstation needs to continuously send the query request, and judges whether the network can be reached or not by combining Ping, so that the consumption of hardware is increased, and the working efficiency is low.
Disclosure of Invention
The object of the present invention is to solve at least to some extent one of the above mentioned technical problems.
Therefore, a first objective of the present invention is to provide a network topology generation method, which can save resources and improve work efficiency.
A second object of the present invention is to provide a network topology generating apparatus.
A third object of the invention is to propose a computer device.
A fourth object of the invention is to propose a non-transitory computer-readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a network topology generating method, where the method includes:
receiving Link Layer Discovery Protocol (LLDP) information sent by routers in a plurality of network segments at regular time, wherein each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segments where the routers are located;
preprocessing the LLDP information and generating an information linked list;
processing the information in the information linked list by utilizing a network segment topology generation algorithm, and generating a network segment topology map;
and integrating the network segment topological graph by using a network topology generating algorithm to generate a network topological graph.
Optionally, the method further comprises:
after the network topology map is generated, the network topology map is output.
And outputting the network topological graph, and displaying the network topological graph to a network manager, so that the network manager can conveniently manage the network according to the network topological graph.
Optionally, the LLDP information includes a host ID, a destination address, interface information, an interface address, and a destination host ID.
The LLDP information can be acquired more accurately.
Optionally, processing the information in the information linked list by using a network segment topology generation algorithm, and generating a network segment topology map, including:
providing a first pointer structure and a second pointer structure;
scanning and acquiring host information in the information linked list by using a first pointer structure;
scanning and acquiring the switch information in the information linked list by using the second pointer structure;
and generating the network segment topological graph according to the host information and the switch information.
And (3) acquiring host information and switch information by refining the step of generating the network segment topological graph, and generating an accurate network segment topological graph.
Optionally, the step of integrating the network segment topological graph by using a network topology generating algorithm to generate a network topological graph includes:
acquiring LLDP information of a first router;
acquiring LLDP information of a second router;
judging whether the host ID in the LLDP information of the second router is in the information linked list or not;
if the host ID in the LLDP information of the second router is in the information linked list, further judging whether the first interface information in the LLDP information of the first router is the same as the second interface information in the LLDP information of the second router;
and if the first interface information is the same as the second interface information, connecting the first router and the second router.
And under the condition that the first interface information is the same as the second interface information, connecting the first router and the second router to generate an accurate network topology map.
Optionally, the step of integrating the network segment topological graph by using a network topology generation algorithm to generate a network topological graph further includes:
if the host ID in the LLDP information of the second router is not in the information linked list, further judging whether the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, and if the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, connecting the first router and the second router.
And under the condition that the host ID of the second router is not in the information linked list, reversely searching the host ID of the destination address to realize the connection of the first router and the second router and generate an accurate network topology map.
Optionally, the step of integrating the network segment topological graph by using a network topology generation algorithm to generate a network topological graph further includes:
traversing LLDP information of all routers in the network;
and sequentially comparing the LLDP information of the current router with the LLDP information of the routers before the current router one by one to determine the connection relation between the current router and the routers before the current router.
And information is acquired in a segmented manner, so that the data acquisition efficiency is improved.
According to the network topology generation method provided by the embodiment of the invention, the LLDP information sent by the routers in the network segments at regular time is received, the network segment topological graph is generated by using the network segment topological generation algorithm, and the network topological graph is generated by using the network topological generation algorithm, so that the resources can be saved, and the working efficiency can be improved.
In order to achieve the above object, a second embodiment of the present invention provides a network topology generating apparatus, including:
the device comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving Link Layer Discovery Protocol (LLDP) information sent by routers in a plurality of network segments at regular time, each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segment where the router is located;
the preprocessing module is used for preprocessing the LLDP information and generating an information linked list;
the first generation module is used for processing the information in the information linked list by utilizing a network segment topology generation algorithm and generating a network segment topology map;
and the second generation module is used for integrating the network segment topological graph by utilizing a network topology generation algorithm to generate a network topological graph.
Optionally, the apparatus further comprises:
and the output module is used for outputting the network topological graph after the network topological graph is generated.
Optionally, the LLDP information includes a host ID, a destination address, interface information, an interface address, and a destination host ID.
Optionally, the first generating module is configured to:
providing a first pointer structure and a second pointer structure;
scanning and acquiring host information in the information linked list by using a first pointer structure;
scanning and acquiring the switch information in the information linked list by using the second pointer structure;
and generating the network segment topological graph according to the host information and the switch information.
Optionally, the second generating module is configured to:
acquiring LLDP information of a first router;
acquiring LLDP information of a second router;
judging whether the host ID in the LLDP information of the second router is in the information linked list or not;
if the host ID in the LLDP information of the second router is in the information linked list, further judging whether the first interface information in the LLDP information of the first router is the same as the second interface information in the LLDP information of the second router;
and if the first interface information is the same as the second interface information, connecting the first router and the second router.
Optionally, the second generating module is further configured to:
if the host ID in the LLDP information of the second router is not in the information linked list, further judging whether the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, and if the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, connecting the first router and the second router.
Optionally, the second generating module is further configured to:
traversing LLDP information of all routers in the network;
and sequentially comparing the LLDP information of the current router with the LLDP information of the routers before the current router one by one to determine the connection relation between the current router and the routers before the current router.
The network topology generating device of the embodiment of the invention can save resources and improve working efficiency by receiving the LLDP information sent by the routers in a plurality of network segments at regular time, generating the network segment topological graph by using the network segment topological generating algorithm, generating the network topological graph by using the network topology generating algorithm and finally outputting the network topological graph.
In order to achieve the above object, an embodiment of a third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the network topology generating method according to the embodiment of the first aspect.
In order to achieve the above object, a non-transitory computer-readable storage medium is further provided in an embodiment of a fourth aspect of the present invention, and a computer program is stored on the non-transitory computer-readable storage medium, where the computer program is configured to, when executed by a processor, implement the network topology generating method according to the embodiment of the first aspect.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow diagram of a network topology generation method of one embodiment of the present invention;
FIG. 2 is a flow diagram of generating a network segment topology diagram of one embodiment of the present invention;
FIG. 3 is a flow diagram of generating a network topology diagram of one embodiment of the present invention;
FIG. 4 is a flow chart of generating a network topology diagram of another embodiment of the present invention;
FIG. 5 is a flow diagram of a network topology generation method of another embodiment of the present invention;
FIG. 6 is a schematic diagram of a network architecture according to an embodiment of the present invention;
FIG. 7 is a block diagram of a network management workstation in accordance with an embodiment of the present invention;
FIG. 8 is a flowchart for generating a network segment topology map in accordance with an embodiment of the present invention;
FIG. 9 is a flow chart of generating a network topology diagram in accordance with a specific embodiment of the present invention;
fig. 10 is a schematic structural diagram of a network topology generating apparatus according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of a network topology generating apparatus according to another embodiment of the present invention.
Detailed Description
It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict. The present invention will be described in detail below with reference to the embodiments with reference to the attached drawings.
The present invention is described in further detail below with reference to specific examples, which are not to be construed as limiting the scope of the invention as claimed.
A network topology generation method, an apparatus, and a computer device according to an embodiment of the present invention are described below with reference to the drawings.
Fig. 1 is a flowchart of a network topology generation method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
and S1, receiving the link layer discovery protocol LLDP information sent by the routers in the network segments at regular time.
Each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segments where the routers are located. LLDP information may include host ID, destination address, interface information, interface address, destination host ID, etc.
In the prior art, the network management workstation needs to continuously send the query request, thereby consuming a large amount of resources. In this embodiment, the network management workstation does not need to send a query request, but the network is divided into a plurality of network segments, each network segment is equipped with at least one router, and the router actively reports information in the network segment to the network management workstation.
And S2, preprocessing the LLDP information and generating an information linked list.
The preprocessing can include operations such as screening out invalid information and normalizing.
And S3, processing the information in the information linked list by using a network segment topology generation algorithm, and generating a network segment topology map.
As shown in fig. 2, generating the network segment topology specifically includes the following steps:
s31, a first pointer structure and a second pointer structure are provided.
The first pointer structure is used for scanning and acquiring host information, and the second pointer structure is used for acquiring switch information.
And S32, scanning and acquiring the host information in the information linked list by using the first pointer structure.
And S33, scanning and acquiring the switch information in the information linked list by using the second pointer structure.
And S34, generating a network segment topological graph according to the host information and the switch information.
And S4, integrating the network segment topological graph by using a network topology generating algorithm to generate a network topological graph.
As shown in fig. 3, generating the network topology specifically includes the following steps:
s41, acquiring the LLDP information of the first router.
And S42, acquiring the LLDP information of the second router.
S43, determining whether the host ID in the LLDP information of the second router is in the information linked list.
S44, if the host ID in the LLDP information of the second router is in the information linked list, further determining whether the first interface information in the LLDP information of the first router is the same as the second interface information in the LLDP information of the second router. If so, it jumps to step S45. If not, the first router and the second router are not connected, and no connection is performed.
And S45, connecting the first router and the second router.
As shown in fig. 4, generating the network topology further includes:
s46, if the host ID in the LLDP information of the second router is not in the information chain table, further judging whether the host ID corresponding to the destination address in the LLDP information of the second router is in the information chain table. If the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, go to step S45. I.e. connecting the first router and the second router. If the host ID corresponding to the destination address is not in the information linked list, it indicates that there is no connection relationship between the first router and the second router, and no connection is made.
The above steps mainly describe determining a connection relationship between a first router and a second router in a network. And generating a network topology map requires determining the connection relationships between all routers in the network. Therefore, the LLDP information of all routers in the network is traversed, and then the LLDP information of the current router is compared with the LLDP information of the previous router one by one in order to determine the connection relationship between the current router and the previous router, so as to generate a complete network topology map.
According to the network topology generation method provided by the embodiment of the invention, the LLDP information sent by the routers in the network segments at regular time is received, the network segment topological graph is generated by using the network segment topological generation algorithm, and the network topological graph is generated by using the network topological generation algorithm, so that the resources can be saved, and the working efficiency can be improved.
In another embodiment of the present invention, as shown in fig. 5, the network topology generating method further includes:
and S5, outputting the network topological graph after the network topological graph is generated.
Hardware loss is reduced, and the working efficiency is further improved.
The network topology generation method of the present invention is explained in detail by a specific embodiment.
First, as shown in fig. 6, a network is divided into a plurality of network segments, and a router of one network segment is responsible for collecting LLDP information of each host in the network segment, so that the efficiency of data collection can be improved.
Secondly, the router in one network segment sends the collected LLDP information to the network management workstation in a timing mode. The router sends LLDP information to the network management workstation at regular intervals to generate the topology. Each router is only responsible for managing the topology information in the network segment, and communication among the devices is reduced, so that the utilization rate of the devices is effectively improved. The network management workstation can acquire the routing table information through a route-n command and acquire the interface information through an ifconfig command.
The network station is described in detail below.
As shown in fig. 7, the network management workstation may include a receiving unit 61, a processor 62, a segment topology generation algorithm unit 63, a network topology generation algorithm unit 64, and a transmitting unit 65.
The receiving unit 61 is configured to receive LLDP information of each host periodically sent by a router in a plurality of network segments.
And the processor 62 is configured to pre-process the received LLDP information of each host, and send the received LLDP information to the segment topology generation algorithm unit 63.
And a network segment topology generating algorithm unit 63, configured to perform algorithm processing on the received LLDP information of each host, and generate a network segment topology map. Then, the segment topology generating algorithm unit 63 feeds back the segment topology map to the processor 62. The processor 62 then sends the segment topology map to the network topology generation algorithm unit 64.
And the network topology generation algorithm unit 64 is used for integrating the network segment topological graph to generate a network topological graph.
And a sending unit 65, configured to output the generated network topology map.
The specific process of generating the network segment topology is described in detail below.
As shown in fig. 8, the following steps may be included:
and S71, acquiring the LLDP information record sent by the router in the network segment.
One LLDP information record is set to Route _ Info 1. Route _ Info1 is a structure containing pointers to the structure SwitchInfo and the structure hostnfo.
S72, the content pointed by the HostInfo pointer of the scanning structure.
The structure hostnfo contains host information.
S73, the content pointed to by the scan structure SwitchInfo pointer.
Each time the structure SwitchInfo pointer scans a switchlnfo, it indicates that a switch is scanned. The SwitchInfo also contains a pointer to the hostnfo, and when the switch information is scanned, the host information associated with the switch can be obtained.
Thus, the host information and the switch information contained in the LLDP information record Route _ Info1 can be acquired.
S74, taking down one LLDP information record, and repeatedly executing the processes of the steps S72 to S73.
And traversing all the LLDP information records, and acquiring host information and switch information contained in each LLDP information record so as to generate a network segment topological graph.
The specific process of generating the network topology map is described in detail below.
As shown in fig. 9, the following steps may be included:
s81, acquiring the LLDP information record sent by the router in a network segment.
Assume a router R1(R1_ HostId, R1_ Iface, R1_ ifacetp, R1_ DIp). Wherein, the HostId represents a unique identification host, the DIp represents a destination address, the Iface represents a forwarding interface, and the IfaceIp represents an address of the forwarding interface.
Node R1 is identified and R1_ HostId and R1_ Iface are placed in the linked list Link. The identifier R1 is equivalent to calibrating a label for R1, and whether Rn and R1 have a connection relationship can be determined through the label in the subsequent generation process of the topological graph.
And S82, acquiring the LLDP information record sent by the router in the second network segment.
Set to R2(R2_ HostId, R2_ Iface, R2_ ifacetp, R2_ DIp).
First, whether R2_ HostId is in the linked list Link is judged, which can be divided into two cases.
1) When R2_ HostId is not in the linked list Link
And judging whether the host ID corresponding to the node R2_ DIp is in the linked list Link or not. If in the linked list Link, the explanation can determine that there is a connection relationship between R1 and R2 through DIp, so R1 and R2 are connected. On the other hand, if the host ID corresponding to R2_ DIp is not in the linked list Link, it indicates that R1 and R2 have no connection relationship and are independent networks.
2) When R2_ HostId is in the linked list Link
And judging whether the R2_ Iface is the same as the corresponding R1_ Iface in the linked list Link or not. If they are the same, R1 and R2 are linked. If not, R1 and R2 have no connection relationship. At this time, although there is no connection relationship between R1 and R2, by means of marking R2, the subsequent nodes such as R4 and R5 can find R2 through the identifier, so as to determine whether the subsequent nodes can have a connection relationship with R2. For example, if R5_ Iface is subsequently the same as R2_ Iface, then R5 and R2 are connected. Of course, if the Iface of other nodes is the same as R2_ Iface, the corresponding node may be connected to another edge of R2.
And S83, traversing the LLDP information records sent by all routers in the network.
The above procedure is repeated for R3, R4, … …, Rn.
And S84, emptying the linked list Link.
The link of the link list is emptied to prevent the LLDP information record from being used for other purposes and ensure the information safety; in addition, when the network topology map is generated next time by using the linked list link, if the current LLDP information record remains in the linked list link, an error may be generated in the network topology map.
In the embodiment, the routers send information to the network management workstation at regular intervals to generate topology, and each router is only responsible for managing the topology information in the network segment, so that the communication between devices is reduced, the device utilization rate and the collection efficiency of the LLDP information are effectively improved, and the data processing efficiency is improved while data loss is prevented.
In order to implement the above embodiments, the present invention further provides a network topology generating apparatus.
Fig. 10 is a schematic structural diagram of a network topology generating apparatus according to an embodiment of the present invention.
As shown in fig. 10, the apparatus includes a receiving module 91, a preprocessing module 92, a first generating module 93, and a second generating module 94.
The receiving module 91 is configured to receive link layer discovery protocol LLDP information periodically sent by routers in multiple network segments.
Each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segments where the routers are located. The LLDP information includes a host ID, a destination address, interface information, an interface address, and a destination host ID.
The preprocessing module 92 is configured to preprocess the LLDP information and generate an information linked list.
The first generating module 93 is configured to process the information in the information linked list by using a network segment topology generating algorithm, and generate a network segment topology map.
A first generating module 93, which is specifically configured to set a first pointer structure and a second pointer structure; scanning and acquiring host information in an information linked list by using a first pointer structure; scanning and acquiring switch information in the information linked list by using a second pointer structure; and generating a network segment topological graph according to the host information and the switch information.
And a second generating module 94, configured to integrate the network segment topology map by using a network topology generating algorithm to generate a network topology map.
A second generating module 94, specifically configured to obtain LLDP information of the first router; acquiring LLDP information of a second router; judging whether the host ID in the LLDP information of the second router is in the information linked list or not; if the host ID in the LLDP information of the second router is in the information linked list, further judging whether the first interface information in the LLDP information of the first router is the same as the second interface information in the LLDP information of the second router; and if the first interface information is the same as the second interface information, connecting the first router and the second router.
The second generating module 94 is further configured to further determine whether the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list if the host ID in the LLDP information of the second router is not in the information linked list, and connect the first router and the second router if the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list.
The second generating module 94 is further configured to traverse LLDP information of all routers in the network; and sequentially comparing the LLDP information of the current router with the LLDP information of the routers before the current router one by one to determine the connection relation between the current router and the routers before the current router.
It should be understood that the network topology generating apparatus of this embodiment is consistent with the description of the network topology generating method of the first aspect, and is not described herein again.
The network topology generating device of the embodiment of the invention can save resources and improve working efficiency by receiving the LLDP information sent by the routers in a plurality of network segments at regular time, generating the network segment topological graph by using the network segment topological generating algorithm, generating the network topological graph by using the network topology generating algorithm and finally outputting the network topological graph.
In another embodiment of the present invention, as shown in fig. 11, the network topology generating apparatus further includes:
an output module 95, configured to output the network topology map after generating the network topology map.
In order to implement the above embodiments, the present invention further provides a computer device.
The computer device comprises a memory, a processor and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the network topology generating method as the embodiment of the first aspect is realized.
In order to implement the above embodiments, the present invention also provides a non-transitory computer-readable storage medium.
The non-transitory computer-readable storage medium has stored thereon a computer program which, when executed by a processor, implements a network topology generation method as an embodiment of the first aspect.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It should be noted that in the description of the present specification, reference to the description of the term "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 invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean 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 invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.

Claims (10)

1. A method for generating a network topology, comprising:
receiving Link Layer Discovery Protocol (LLDP) information sent by routers in a plurality of network segments at regular time, wherein each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segments where the routers are located;
preprocessing the LLDP information and generating an information linked list;
processing the information in the information linked list by utilizing a network segment topology generation algorithm, and generating a network segment topology map;
and integrating the network segment topological graph by using a network topology generating algorithm to generate a network topological graph.
2. The method of claim 1, further comprising:
after the network topology map is generated, the network topology map is output.
3. The method of claim 1, wherein the LLDP information comprises a host ID, a destination address, interface information, an interface address, and a destination host ID.
4. The method of claim 1, wherein processing the information in the information linked list using a segment topology generation algorithm and generating a segment topology map comprises:
providing a first pointer structure and a second pointer structure;
scanning and acquiring host information in the information linked list by using a first pointer structure;
scanning and acquiring the switch information in the information linked list by using the second pointer structure;
and generating the network segment topological graph according to the host information and the switch information.
5. The method of claim 1, wherein generating a network topology map using a network topology generation algorithm that integrates the segment topology maps comprises:
acquiring LLDP information of a first router;
acquiring LLDP information of a second router;
judging whether the host ID in the LLDP information of the second router is in the information linked list or not;
if the host ID in the LLDP information of the second router is in the information linked list, further judging whether the first interface information in the LLDP information of the first router is the same as the second interface information in the LLDP information of the second router;
and if the first interface information is the same as the second interface information, connecting the first router and the second router.
6. The method of claim 5, wherein generating a network topology map using a network topology generation algorithm that integrates the segment topology maps, further comprising:
if the host ID in the LLDP information of the second router is not in the information linked list, further judging whether the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, and if the host ID corresponding to the destination address in the LLDP information of the second router is in the information linked list, connecting the first router and the second router.
7. The method of claim 5, wherein generating a network topology map using a network topology generation algorithm that integrates the segment topology maps, further comprising:
traversing LLDP information of all routers in the network;
and sequentially comparing the LLDP information of the current router with the LLDP information of the routers before the current router one by one to determine the connection relation between the current router and the routers before the current router.
8. A network topology generation apparatus, comprising:
the device comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving Link Layer Discovery Protocol (LLDP) information sent by routers in a plurality of network segments at regular time, each network segment corresponds to at least one router, and the routers are used for collecting the LLDP information in the network segment where the router is located;
the preprocessing module is used for preprocessing the LLDP information and generating an information linked list;
the first generation module is used for processing the information in the information linked list by utilizing a network segment topology generation algorithm and generating a network segment topology map;
and the second generation module is used for integrating the network segment topological graph by utilizing a network topology generation algorithm to generate a network topological graph.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the network topology generating method of any of claims 1-7 when executing the computer program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the network topology generation method of any of claims 1-7.
CN202011385009.0A 2020-12-01 2020-12-01 Network topology generation method and device and computer equipment Pending CN112600689A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011385009.0A CN112600689A (en) 2020-12-01 2020-12-01 Network topology generation method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011385009.0A CN112600689A (en) 2020-12-01 2020-12-01 Network topology generation method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN112600689A true CN112600689A (en) 2021-04-02

Family

ID=75189057

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011385009.0A Pending CN112600689A (en) 2020-12-01 2020-12-01 Network topology generation method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112600689A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268940A (en) * 2021-12-22 2022-04-01 深圳市共进电子股份有限公司 Mesh network topological graph display method, system, equipment and storage medium
CN115277437A (en) * 2022-07-29 2022-11-01 湖南大学 Network topology construction method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101383772A (en) * 2008-09-26 2009-03-11 中兴通讯股份有限公司 Method and device for automatically discovering and establishing MAC route information table
US8805982B1 (en) * 2007-06-29 2014-08-12 Ciena Corporation Progressively determining a network topology and using neighbor information to determine network topology
CN105207909A (en) * 2014-06-24 2015-12-30 华为技术有限公司 Method for transmitting information and network apparatus
US10206092B1 (en) * 2017-09-29 2019-02-12 Hewlett Packard Enterprise Development Lp Automatic discovery
CN109995591A (en) * 2019-04-09 2019-07-09 苏州浪潮智能科技有限公司 A kind of method and device of the link topology based on LLDP
US20190372858A1 (en) * 2018-05-30 2019-12-05 Cisco Technology, Inc. Network fabric visualization and management

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8805982B1 (en) * 2007-06-29 2014-08-12 Ciena Corporation Progressively determining a network topology and using neighbor information to determine network topology
CN101383772A (en) * 2008-09-26 2009-03-11 中兴通讯股份有限公司 Method and device for automatically discovering and establishing MAC route information table
CN105207909A (en) * 2014-06-24 2015-12-30 华为技术有限公司 Method for transmitting information and network apparatus
US10206092B1 (en) * 2017-09-29 2019-02-12 Hewlett Packard Enterprise Development Lp Automatic discovery
CN109587207A (en) * 2017-09-29 2019-04-05 慧与发展有限责任合伙企业 System and method for finding the network equipment automatically
US20190372858A1 (en) * 2018-05-30 2019-12-05 Cisco Technology, Inc. Network fabric visualization and management
CN109995591A (en) * 2019-04-09 2019-07-09 苏州浪潮智能科技有限公司 A kind of method and device of the link topology based on LLDP

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
孙克辉等: "网络层与链路层综合拓扑发现算法及其实现", 《计算机工程与应用》 *
郦江源等: "一种适用于小型网络的网络拓扑生成方法", 《电信快报》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114268940A (en) * 2021-12-22 2022-04-01 深圳市共进电子股份有限公司 Mesh network topological graph display method, system, equipment and storage medium
CN115277437A (en) * 2022-07-29 2022-11-01 湖南大学 Network topology construction method and device, computer equipment and storage medium
CN115277437B (en) * 2022-07-29 2023-12-01 湖南大学 Network topology construction method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110661669B (en) Network topology automatic discovery method of network equipment based on ICMP, TCP and UDP protocols
CN112953737B (en) Configuration abnormality detection method, server, and storage medium
CN112600689A (en) Network topology generation method and device and computer equipment
CN112039693A (en) System and method for managing home networking network topology
US7307962B2 (en) System for inference of presence of network infrastructure devices
CN107733713B (en) Method, system, device and storage medium for acquiring network topology in hybrid network
CN112565095B (en) Automatic discovery and analysis method and device for internet special line
CN101771604B (en) Routing detection method, system and intermediate routing device
CN112822053B (en) SNMP-based link layer network topology structure discovery method and system
CN105141449A (en) Addition method and device for monitoring configuration
CN113542015B (en) Method for automatically drawing network physical link
CN113452561A (en) Topology generation method, device and equipment and readable storage medium
US20100094994A1 (en) Network structure information acquiring method and device
CN112953774A (en) Network topology generation method, system, equipment and computer storage medium
CN113326946A (en) Method, device and storage medium for updating application recognition model
CN110532011A (en) Data converter version upgrading method, device and data communication system
CN108924011A (en) Monitoring system, relevant device, method and medium for OSPF+ Routing Protocol
CN104579978A (en) Link-layer topology discovery method for dynamic network
US7733800B2 (en) Method and mechanism for identifying an unmanaged switch in a network
US20040158780A1 (en) Method and system for presenting neighbors of a device in a network via a graphical user interface
US20140236878A1 (en) Inferring connectivity in the presence of conflicting network data
CN112180757A (en) Intelligent household system and strategy management method thereof
CN114222284B (en) Terminal equipment identification method, device and readable storage medium
CN116260726A (en) Topology discovery method, device, terminal and storage medium
CN114500290A (en) Method, device, equipment and medium for generating cloud platform gateway node detection topology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210402