[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112866011A - Method, device, equipment and medium for determining network topology structure - Google Patents

Method, device, equipment and medium for determining network topology structure Download PDF

Info

Publication number
CN112866011A
CN112866011A CN202110004185.3A CN202110004185A CN112866011A CN 112866011 A CN112866011 A CN 112866011A CN 202110004185 A CN202110004185 A CN 202110004185A CN 112866011 A CN112866011 A CN 112866011A
Authority
CN
China
Prior art keywords
equipment
connection link
connection
target
port
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.)
Granted
Application number
CN202110004185.3A
Other languages
Chinese (zh)
Other versions
CN112866011B (en
Inventor
赵国强
王欣
韦文
蔡莉莉
师进
马兰
杨姝
鲁帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CRSC Research and Design Institute Group Co Ltd
Original Assignee
CRSC Research and Design Institute Group 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 CRSC Research and Design Institute Group Co Ltd filed Critical CRSC Research and Design Institute Group Co Ltd
Priority to CN202110004185.3A priority Critical patent/CN112866011B/en
Publication of CN112866011A publication Critical patent/CN112866011A/en
Application granted granted Critical
Publication of CN112866011B publication Critical patent/CN112866011B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery

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 method, a device, equipment and a medium for discovering a network topology structure. Wherein, the method comprises the following steps: acquiring connection information of target equipment within a target network range; the target equipment comprises a switch and an intelligent terminal; the method comprises the steps that connection information of target equipment is subjected to standardization processing, and a port connection link between at least two switches and a connection link between the switches and an intelligent terminal are obtained; and determining a topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal. The embodiment of the invention can automatically generate the network topology structure according to the connection information between the target devices to be discovered, thereby effectively improving the generation efficiency of the network topology structure.

Description

Method, device, equipment and medium for determining network topology structure
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a method, a device, equipment and a medium for determining a network topology structure.
Background
In the network management process, network topology information is important for management personnel, and a network topology structure diagram provides an expression form for knowing the connection condition of a global network. The network management personnel can grasp the condition of the network as a whole through the network topology structure chart, thereby carrying out correct planning and configuration on the equipment in the network. The existing network topology structure is usually organized and arranged by management personnel and manually input into a network management system, and the completion of the network topology structure is realized by utilizing manual configuration addition.
The defects of the scheme are as follows: when the network has a large scale and the topology structure changes a lot, the generation of the network topology structure is difficult to be effectively and accurately realized by using a manual configuration mode by a manager, and the management efficiency of the network equipment is greatly reduced.
Disclosure of Invention
Embodiments of the present application provide a method, an apparatus, a device, and a medium for determining a network topology structure, which may automatically generate the network topology structure according to connection information of a network device to be discovered, so as to effectively improve management efficiency of the network topology structure.
In a first aspect, an embodiment of the present invention provides a method for discovering a network topology, including:
acquiring connection information of target equipment within a target network range; the target equipment comprises a switch and an intelligent terminal;
standardizing the connection information of the target equipment to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal;
and determining the topological structure within the range of the target network according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal.
Optionally, the connection information of the target device includes an association relationship between an IP address and a device MAC address, an association relationship between a port number and a port MAC address, and a port connection link of an adjacent target device.
Optionally, the obtaining of the connection information of the target device within the range of the target network includes:
acquiring an IP address of target equipment within a target network range;
and determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol.
Optionally, the normalizing the connection information of the target device to obtain a port connection link between at least two switches and a connection link between a switch and an intelligent terminal includes:
establishing an equipment initial connection link between every two pieces of target equipment in the target network range according to the port connection links of the adjacent target equipment;
creating a first storage set according to the incidence relation between the IP address and the equipment MAC address; creating a second storage set according to the incidence relation between the port number and the equipment MAC address;
determining a port connection link between at least two switches according to the initial connection link of the equipment and the first storage set; and determining a connection link between the switch and the intelligent terminal according to the initial connection link of the equipment, the first storage set and the second storage set.
Optionally, determining a port connection link between at least two switches according to the device initial connection link and the first storage set includes:
determining a port MAC address of initial connection equipment in the initial connection link according to the incidence relation between the port number and the port MAC address, and searching an IP address of termination equipment in the initial connection link of the equipment from the first storage set so as to complete information of the initial connection link of the equipment and obtain a complete connection link of the equipment;
and carrying out link duplicate removal processing on the equipment completion connection link to obtain a port connection link between at least two switches.
Optionally, determining a connection link between the switch and the intelligent terminal according to the device initial connection link, the first storage set, and the second storage set includes:
acquiring initial connection equipment and termination connection equipment of the initial connection link of the equipment;
deleting the incidence relation between the IP address of the initial connection device and the MAC address of the device and the incidence relation between the IP address of the termination connection device and the MAC address of the device from the first storage set to obtain a third storage set; deleting the incidence relation between the port number of the initial connection equipment and the equipment MAC address and the incidence relation between the port number of the termination connection equipment and the equipment MAC address from the second storage set to obtain a fourth storage set;
and determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set.
Optionally, determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set includes:
acquiring an IP address of an equipment MAC address associated with the port number in the fourth storage set from the third storage set to obtain an intelligent terminal;
and taking the switch associated with the port number in the fourth storage set as initial connection equipment, taking the intelligent terminal as termination connection equipment, and establishing a connection link between the switch and the intelligent terminal.
In a second aspect, an embodiment of the present invention provides a device for discovering a network topology, including:
the information acquisition module is used for acquiring the connection information of the target equipment within the range of the target network; the target equipment comprises a switch and an intelligent terminal;
the connection link determining module is used for carrying out standardization processing on the connection information of the target equipment to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal;
and the topological structure determining module is used for determining the topological structure within the range of the target network according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal.
Optionally, the connection information of the target device includes an association relationship between an IP address and a device MAC address, an association relationship between a port number and a port MAC address, and a port connection link of an adjacent target device.
Optionally, the information obtaining module is specifically configured to:
acquiring an IP address of target equipment within a target network range;
and determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol.
Optionally, the connection link determining module includes a connection link establishing unit, a storage set creating unit, a first determining unit, and a second determining unit;
a connection link establishing unit, configured to establish an initial device connection link between every two target devices within the target network range according to the port connection link of the adjacent target device;
a storage set creating unit, configured to create a first storage set according to an association relationship between the IP address and the device MAC address; creating a second storage set according to the incidence relation between the port number and the equipment MAC address;
a first determining unit, configured to determine a port connection link between at least two switches according to the device initial connection link and the first storage set;
and the second determining unit is used for determining the connection link between the switch and the intelligent terminal according to the initial connection link of the equipment, the first storage set and the second storage set.
Optionally, the first determining unit is specifically configured to:
determining a port MAC address of initial connection equipment in the initial connection link according to the incidence relation between the port number and the port MAC address, and searching an IP address of termination equipment in the initial connection link of the equipment from the first storage set so as to complete information of the initial connection link of the equipment and obtain a complete connection link of the equipment;
and carrying out link duplicate removal processing on the equipment completion connection link to obtain a port connection link between at least two switches.
Optionally, the second determining unit includes an apparatus acquiring subunit, a set determining subunit, and a link determining subunit;
the device acquisition subunit is used for acquiring initial connection equipment and termination connection equipment of the initial connection link of the device;
a set determining subunit, configured to delete, from the first storage set, an association relationship between the IP address of the initial connection device and the device MAC address and an association relationship between the IP address of the termination connection device and the device MAC address, so as to obtain a third storage set; deleting the incidence relation between the port number of the initial connection equipment and the equipment MAC address and the incidence relation between the port number of the termination connection equipment and the equipment MAC address from the second storage set to obtain a fourth storage set;
and the link determining subunit is used for determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set.
Optionally, the link determining subunit is specifically configured to:
acquiring an IP address of an equipment MAC address associated with the port number in the fourth storage set from the third storage set to obtain an intelligent terminal;
and taking the switch associated with the port number in the fourth storage set as initial connection equipment, taking the intelligent terminal as termination connection equipment, and establishing a connection link between the switch and the intelligent terminal.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method for discovering a network topology according to any one of the embodiments of the present invention.
In a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for discovering a network topology according to any one of the embodiments of the present invention.
The embodiment of the invention obtains the connection information of the target equipment in the range of the target network; the target equipment comprises a switch and an intelligent terminal; the method comprises the steps that connection information of target equipment is subjected to standardization processing, and a port connection link between at least two switches and a connection link between the switches and an intelligent terminal are obtained; and determining a topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal. The embodiment of the invention can automatically generate the network topology structure according to the connection information between the target devices to be discovered, thereby effectively improving the generation efficiency of the network topology structure.
Drawings
Fig. 1 is a flowchart illustrating a method for discovering a network topology according to a first embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for discovering a network topology according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a discovery apparatus of a network topology according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device in the fourth embodiment.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart illustrating a method for discovering a network topology according to a first embodiment of the present invention. The embodiment can be applied to the situation of quickly discovering the connection relation among the devices within the reach of the network. The method of the embodiment may be performed by a discovery apparatus of a network topology, which may be implemented in hardware and/or software and may be configured in an electronic device. The method for discovering the network topology structure can be realized according to any embodiment of the application. As shown in fig. 1, the method specifically includes the following steps:
s110, acquiring connection information of target equipment in a target network range; the target equipment comprises a switch and an intelligent terminal.
In this embodiment, the target network range is a network reachable range of the target device; for example, two intelligent terminals need information transmission, wherein information interaction between the intelligent terminals needs to be implemented by using a switch. The connection information of the target device is the information of the basic information of the target device and the interconnection device. Specifically, the connection Information of each target device is stored in a Management Information Base (MIB) for direct fast lookup according to an Internet Protocol (IP) address of the target device.
The step of obtaining the connection information of the target device in the range of the target network comprises the following steps: and calling an information reading component to acquire the connection information of the target equipment from the management information base. The information reading component is an information reading interface obtained by a system developer through software programming and is used for connecting the management information base so as to quickly and intelligently read related information from the management information base.
It should be noted that the target device in this embodiment may further include an electronic device for information transmission, such as a router.
S120, the connection information of the target equipment is standardized to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal.
In this embodiment, since the connection information of the target devices has a problem of information loss or information redundancy, in order to obtain a complete and single connection link between the target devices, it is necessary to process the connection information of the target devices.
The intelligent terminal comprises an intelligent terminal, a switch, a port and a power supply, wherein the switch is connected with the switch through the port; in particular, a plurality of connection ports may be included on a switch to enable information to be transmitted indefinitely across a limited number of switches.
S130, determining a topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal.
In the network management process, network topology information is important for managers, and a network topology structure chart can provide an expression form for knowing the connection condition of the global network; network management personnel can integrally master the network condition through the network topology structure, so that the target equipment in the network is correctly planned and configured, and the operation and maintenance management efficiency of the network is effectively improved.
The method for determining the topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal comprises the following steps: taking an exchanger in a connection link between the exchanger and the intelligent terminal as initial connection equipment, and determining a first exchanger connected with the port of the exchanger from a port connection link between at least two exchangers as termination connection equipment; or, the switch in the connection link between the switch and the intelligent terminal is used as a termination connection device, and a first switch connected with the switch port is determined from the port connection link between at least two switches and is used as an initial connection device; and establishing a connection link between the starting connection device and the terminating connection device to obtain the link connection of a port connection link between at least two switches and a connection link between the switch and the intelligent terminal, thereby obtaining a topological structure within the range of the target network.
The embodiment of the invention obtains the connection information of the target equipment in the range of the target network; the target equipment comprises a switch and an intelligent terminal; the method comprises the steps that connection information of target equipment is subjected to standardization processing, and a port connection link between at least two switches and a connection link between the switches and an intelligent terminal are obtained; and determining a topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal. The embodiment of the invention can automatically generate the network topology structure according to the connection information between the target devices to be discovered, thereby effectively improving the generation efficiency of the network topology structure.
Example two
Fig. 2 is a flowchart illustrating a method for discovering a network topology according to a second embodiment of the present invention. The embodiment is further expanded and optimized on the basis of the embodiment, and can be combined with any optional alternative in the technical scheme. As shown in fig. 2, the method includes:
s210, acquiring connection information of target equipment within a target network range; the target equipment comprises a switch and an intelligent terminal.
In this embodiment, optionally, the connection information of the target device includes an association relationship between an IP address and a device MAC address, an association relationship between a port number and a port MAC address, and a port connection link of an adjacent target device.
If the target device is a switch, one switch has an IP address, a Media Access Control (MAC) address (i.e., a physical address), a plurality of ports, and one port corresponds to one MAC address; if the target equipment is an intelligent terminal, one intelligent terminal has one IP address, one IP address corresponds to one equipment MAC address, and if the intelligent terminal has no port, the intelligent terminal has no corresponding port MAC address.
It should be noted that the switch in this embodiment may support SNMP (Simple Network Management Protocol) and LLDP (Link Layer Discovery Protocol).
S220, establishing an equipment initial connection link between every two target equipment in the range of the target network according to the port connection links of the adjacent target equipment.
In this embodiment, the device initial connection link is a connection link formed by all target devices within the range of the target network; since the initial connection link of the device is obtained by connecting all target devices as initial connection devices, there may be information loss or information redundancy in the initial connection link of the device, and further processing is required.
The initial connection link of the device can be seen in table 1 below.
TABLE 1 initial connection Link Table of devices
Figure BDA0002882871340000101
In table 1, start IP, start Port, and start Mac are the IP address, Port number, and Port Mac address of the initial connection device, respectively; end IP, end Port and end Mac are the IP address, Port number and Port MAC address of the terminating connection device, respectively.
S230, creating a first storage set according to the incidence relation between the IP address and the equipment MAC address; and creating a second storage set according to the incidence relation between the port number and the MAC address of the equipment.
In this embodiment, the first storage set and the second storage set respectively store different connection information of the target device, so as to store the connection information of the target device in a classified manner.
Illustratively, the target devices include sw1 (switch 1), sw2 (switch 2), sw3 (switch 3), com1 (intelligent terminal 1) and com2 (intelligent terminal 2); the first storage set can be seen in table 2 below; the second storage set can be seen in table 3 below.
Table 2 first storage set storage table
IP address Device MAC address
192.168.1.1 sw1Mac
192.168.1.2 sw2Mac
192.168.1.3 sw3Mac
192.168.1.4 com1
192.168.1.5 com2
Table 3 second storage set storage table
Figure BDA0002882871340000111
Figure BDA0002882871340000121
In table 3, the device MAC corresponding to the port number is a device MAC address where the port number of the device can reach the device; sw1A and sw1B are respectively an A port and a B port of sw 1; sw2A and sw2B are respectively an A port and a B port of sw 2; sw3A and sw3B are the A port and B port of sw3, respectively.
S240, determining a port connection link between at least two switches according to the initial connection link of the equipment and the first storage set; and determining a connection link between the switch and the intelligent terminal according to the initial connection link of the equipment, the first storage set and the second storage set.
In this embodiment, a port connection link between two switches is a link connected between two switches through a port; the connection link between the switch and the intelligent terminal is a link for connecting a port of the switch and the intelligent terminal; specifically, the intelligent terminal in this embodiment may be a computer.
In this embodiment, the connection information of the target devices is classified and stored in the corresponding sets, and the connection links between the target devices are effectively determined according to the unique matching between different pieces of information stored in the sets.
And S250, determining a topological structure within the range of the target network according to the port connection link between at least two switches and the connection link between the switch and the intelligent terminal.
On the basis of the foregoing embodiment, optionally, the obtaining of the connection information of the target device in the target network range includes:
acquiring an IP address of target equipment within a target network range;
and determining the connection information of the target equipment according to the IP address of the target equipment based on the network management protocol.
In this embodiment, determining the connection information of the target device according to the IP address of the target device based on the network management protocol may include: traversing all the IP addresses of the target devices in the range of the target network, and obtaining the MIB (i.e., connection information in this embodiment) of the IP address through a network management protocol, such as SNMP; if the relevant information of the IP address cannot be obtained, the IP address is not reachable, and the IP address is discarded. The method can directly acquire the effective connection information of the target equipment.
On the basis of the foregoing embodiment, optionally, determining a port connection link between at least two switches according to the device initial connection link and the first storage set includes:
determining a port MAC address of initial connection equipment in an initial connection link according to the incidence relation between the port number and the port MAC address, and searching an IP address of termination equipment in the initial connection link of the equipment from a first storage set so as to complete information of the initial connection link of the equipment and obtain a complete connection link of the equipment;
and carrying out link deduplication processing on the equipment completion connection link to obtain a port connection link between at least two switches.
In this embodiment, since the initial connection link table of the device lacks the MAC address of the port of the initial connection device and the IP address of the terminating connection device, information completion needs to be performed on the initial connection link of the device, and the completed device completed connection link may be referred to in table 4 below.
TABLE 4 complete connection link table for equipment
Figure BDA0002882871340000131
Figure BDA0002882871340000141
It can be seen that there are two duplicate links in table 4, i.e., there are two connection links with port number sw1A and port number sw 2A; namely, two connection links with port numbers sw1B and sw3A are provided; removing any link in the repeated links, and reserving one link; the complexity of the link can be effectively simplified to ensure the unique connectivity of the link.
The port connection links between the switches can be seen in table 5 below.
TABLE 5 Port connection links between switches
start IP 192.168.1.1 192.168.1.1
start Port sw1A sw1B
start Mac sw1MacA sw1MacB
end IP 192.168.1.2 192.168.1.3
end Port sw2A sw3A
end Mac sw2MacA sw3MacA
On the basis of the foregoing embodiment, optionally, determining the connection link between the switch and the intelligent terminal according to the device initial connection link, the first storage set, and the second storage set includes:
acquiring initial connection equipment and termination connection equipment of an initial connection link of the equipment;
deleting the incidence relation between the IP address of the initial connection device and the MAC address of the device and the incidence relation between the IP address of the termination connection device and the MAC address of the device from the first storage set to obtain a third storage set; deleting the incidence relation between the port number of the initial connection equipment and the equipment MAC address and the incidence relation between the port number of the termination connection equipment and the equipment MAC address from the second storage set to obtain a fourth storage set;
and determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set.
In this embodiment, it can be seen from table 5 that there are two connection links, the initial connection device is switch 1, and the terminating connection devices are switch 2 and switch 3, respectively. The third storage set obtained by the deletion operation can be referred to table 6; the fourth storage set can be seen in table 7.
Table 6 third memory set table
IP address Device MAC address
192.168.1.4 com1
192.168.1.5 com2
TABLE 7 fourth storage set Table
Port number Device MAC address
sw2B com1
sw3B com2
It can be seen that table 6 retains the self information of the intelligent terminal; the smart device and connection relationships are retained in table 7. Then, the intelligent terminal 1 can be connected with the port B of the switch 2; the intelligent terminal 2 is connected with the B port of the switch 3.
Through the operation, the connection link between the intelligent terminal and the port of the switch can be rapidly screened out by the embodiment.
On the basis of the foregoing embodiment, optionally, determining the connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set includes:
acquiring an IP address of an equipment MAC address associated with the port number in the fourth storage set from the third storage set to obtain an intelligent terminal;
and taking the switch associated with the port number in the fourth storage set as initial connection equipment, taking the intelligent terminal as termination connection equipment, and establishing a connection link between the switch and the intelligent terminal.
In this embodiment, obtaining the IP address of the device MAC address associated with the port number in the fourth storage set from the third storage set may include: traversing each port number in the third storage set to obtain an incidence relation between the port number and the equipment MAC address of the target equipment; finding out a corresponding IP address from the third storage set according to the MAC address of the equipment so as to determine the intelligent terminal; and establishing a connection link between the port of the switch and the intelligent terminal according to the incidence relation between the port number in the fourth storage set and the MAC address of the equipment.
Establishing a connection link between a port of the switch and the intelligent terminal may include: establishing an incidence relation between the IP address of the switch and the IP address of the intelligent terminal; establishing an incidence relation between the switch and the port number of the intelligent terminal; and establishing the incidence relation between the port MAC address of the IP of the switch and the equipment MAC address of the intelligent terminal so as to obtain a connection link between the switch and the intelligent terminal.
According to the embodiment, the intelligent terminal can be accurately found according to the incidence relation between the port number and the equipment MAC address, so that a connection link between the switch and the intelligent terminal is effectively established.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a discovery apparatus of a network topology according to a third embodiment of the present invention, which is applicable to a case of quickly discovering a connection relationship between devices within a network reach range. The device is configured in an electronic device, and can implement the method for discovering the network topology structure according to any embodiment of the present application. The device specifically comprises the following steps:
an information obtaining module 310, configured to obtain connection information of a target device within a target network range; the target equipment comprises a switch and an intelligent terminal;
a connection link determining module 320, configured to perform standardized processing on the connection information of the target device to obtain a port connection link between at least two switches and a connection link between a switch and an intelligent terminal;
a topology structure determining module 330, configured to determine a topology structure within the range of the target network according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal.
On the basis of the foregoing embodiment, optionally, the connection information of the target device includes an association relationship between an IP address and a device MAC address, an association relationship between a port number and a port MAC address, and a port connection link of an adjacent target device.
On the basis of the foregoing embodiment, optionally, the information obtaining module 310 is specifically configured to:
acquiring an IP address of target equipment within a target network range;
and determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol.
On the basis of the foregoing embodiment, optionally, the connection link determining module 320 includes a connection link establishing unit, a storage set creating unit, a first determining unit, and a second determining unit;
a connection link establishing unit, configured to establish an initial device connection link between every two target devices within the target network range according to the port connection link of the adjacent target device;
a storage set creating unit, configured to create a first storage set according to an association relationship between the IP address and the device MAC address; creating a second storage set according to the incidence relation between the port number and the equipment MAC address;
a first determining unit, configured to determine a port connection link between at least two switches according to the device initial connection link and the first storage set;
and the second determining unit is used for determining the connection link between the switch and the intelligent terminal according to the initial connection link of the equipment, the first storage set and the second storage set.
On the basis of the foregoing embodiment, optionally, the first determining unit is specifically configured to:
determining a port MAC address of initial connection equipment in the initial connection link according to the incidence relation between the port number and the port MAC address, and searching an IP address of termination equipment in the initial connection link of the equipment from the first storage set so as to complete information of the initial connection link of the equipment and obtain a complete connection link of the equipment;
and carrying out link duplicate removal processing on the equipment completion connection link to obtain a port connection link between at least two switches.
On the basis of the foregoing embodiment, optionally, the second determining unit includes an apparatus acquiring subunit, a set determining subunit, and a link determining subunit;
the device acquisition subunit is used for acquiring initial connection equipment and termination connection equipment of the initial connection link of the device;
a set determining subunit, configured to delete, from the first storage set, an association relationship between the IP address of the initial connection device and the device MAC address and an association relationship between the IP address of the termination connection device and the device MAC address, so as to obtain a third storage set; deleting the incidence relation between the port number of the initial connection equipment and the equipment MAC address and the incidence relation between the port number of the termination connection equipment and the equipment MAC address from the second storage set to obtain a fourth storage set;
and the link determining subunit is used for determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set.
On the basis of the foregoing embodiment, optionally, the link determining subunit is specifically configured to:
acquiring an IP address of an equipment MAC address associated with the port number in the fourth storage set from the third storage set to obtain an intelligent terminal;
and taking the switch associated with the port number in the fourth storage set as initial connection equipment, taking the intelligent terminal as termination connection equipment, and establishing a connection link between the switch and the intelligent terminal.
By the network topology structure discovery device, the network topology structure can be automatically generated according to the connection information between the target devices to be discovered, and therefore the generation efficiency of the network topology structure is effectively improved.
The network topology discovery device provided by the embodiment of the invention can execute the network topology discovery method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Example four
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention, as shown in fig. 4, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of the processors 410 in the electronic device may be one or more, and one processor 410 is taken as an example in fig. 4; the processor 410, the memory 420, the input device 430 and the output device 440 in the electronic apparatus may be connected by a bus or other means, and the bus connection is exemplified in fig. 4.
The memory 420 serves as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the network topology discovery method in the embodiments of the present invention. The processor 410 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the memory 420, so as to implement the network topology discovery method provided by the embodiment of the present invention.
The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 420 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, memory 420 may further include memory located remotely from processor 410, which may be connected to an electronic device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 430 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus, and may include a keyboard, a mouse, and the like. The output device 440 may include a display device such as a display screen.
EXAMPLE five
The present embodiments provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to implement a method for discovering a network topology provided by embodiments of the present invention.
Of course, the storage medium containing the computer-executable instructions provided by the embodiments of the present invention is not limited to the method operations described above, and may also perform related operations in the method for discovering a network topology provided by any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the present invention can be implemented by software and necessary general hardware, and certainly, can also be implemented by hardware, but the former is a better embodiment in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute the methods according to the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present invention.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for discovering a network topology, the method comprising:
acquiring connection information of target equipment within a target network range; the target equipment comprises a switch and an intelligent terminal;
standardizing the connection information of the target equipment to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal;
and determining the topological structure within the range of the target network according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal.
2. The method of claim 1, wherein the connection information of the target device comprises an association relationship between an IP address and a device MAC address, an association relationship between a port number and a port MAC address, and a port connection link of an adjacent target device.
3. The method of claim 1, wherein obtaining connection information for a target device within range of a target network comprises:
acquiring an IP address of target equipment within a target network range;
and determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol.
4. The method according to claim 2, wherein standardizing the connection information of the target device to obtain a port connection link between at least two switches and a connection link between a switch and an intelligent terminal comprises:
establishing an equipment initial connection link between every two pieces of target equipment in the target network range according to the port connection links of the adjacent target equipment;
creating a first storage set according to the incidence relation between the IP address and the equipment MAC address; creating a second storage set according to the incidence relation between the port number and the equipment MAC address;
determining a port connection link between at least two switches according to the initial connection link of the equipment and the first storage set; and determining a connection link between the switch and the intelligent terminal according to the initial connection link of the equipment, the first storage set and the second storage set.
5. The method of claim 4, wherein determining port connection links between at least two switches from the device initial connection link and the first storage set comprises:
determining a port MAC address of initial connection equipment in the initial connection link according to the incidence relation between the port number and the port MAC address, and searching an IP address of termination equipment in the initial connection link of the equipment from the first storage set so as to complete information of the initial connection link of the equipment and obtain a complete connection link of the equipment;
and carrying out link duplicate removal processing on the equipment completion connection link to obtain a port connection link between at least two switches.
6. The method of claim 4, wherein determining the connection link between the switch and the intelligent terminal according to the device initial connection link, the first storage set and the second storage set comprises:
acquiring initial connection equipment and termination connection equipment of the initial connection link of the equipment;
deleting the incidence relation between the IP address of the initial connection device and the MAC address of the device and the incidence relation between the IP address of the termination connection device and the MAC address of the device from the first storage set to obtain a third storage set; deleting the incidence relation between the port number of the initial connection equipment and the equipment MAC address and the incidence relation between the port number of the termination connection equipment and the equipment MAC address from the second storage set to obtain a fourth storage set;
and determining a connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set.
7. The method of claim 6, wherein determining the connection link between the switch and the intelligent terminal according to the third storage set and the fourth storage set comprises:
acquiring an IP address of an equipment MAC address associated with the port number in the fourth storage set from the third storage set to obtain an intelligent terminal;
and taking the switch associated with the port number in the fourth storage set as initial connection equipment, taking the intelligent terminal as termination connection equipment, and establishing a connection link between the switch and the intelligent terminal.
8. An apparatus for discovering a network topology, the apparatus comprising:
the information acquisition module is used for acquiring the connection information of the target equipment within the range of the target network; the target equipment comprises a switch and an intelligent terminal;
the connection link determining module is used for carrying out standardization processing on the connection information of the target equipment to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal;
and the topological structure determining module is used for determining the topological structure within the range of the target network according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal.
9. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a method of discovering network topologies as claimed in any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a method for discovering a network topology according to any one of claims 1 to 7.
CN202110004185.3A 2021-01-04 2021-01-04 Method, device, equipment and medium for determining network topology structure Active CN112866011B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110004185.3A CN112866011B (en) 2021-01-04 2021-01-04 Method, device, equipment and medium for determining network topology structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110004185.3A CN112866011B (en) 2021-01-04 2021-01-04 Method, device, equipment and medium for determining network topology structure

Publications (2)

Publication Number Publication Date
CN112866011A true CN112866011A (en) 2021-05-28
CN112866011B CN112866011B (en) 2023-09-26

Family

ID=76001390

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110004185.3A Active CN112866011B (en) 2021-01-04 2021-01-04 Method, device, equipment and medium for determining network topology structure

Country Status (1)

Country Link
CN (1) CN112866011B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117354164A (en) * 2023-12-05 2024-01-05 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure
CN118394678A (en) * 2024-04-01 2024-07-26 北京壁仞科技开发有限公司 Distributed computing system, PCIe device and method for generating interconnection topology structure information

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420765A (en) * 2011-12-09 2012-04-18 福建星网锐捷网络有限公司 Method and device for determining physical link between switchboard and terminal
CN109150640A (en) * 2018-11-08 2019-01-04 中国电子科技集团公司第二十八研究所 A kind of method for discovering network topology and system based on double layer network agreement
CN110855486A (en) * 2019-11-11 2020-02-28 国网江苏省电力有限公司检修分公司 Topological mapping label-based topological scanning method for station control layer of power secondary system
CN111600762A (en) * 2020-06-02 2020-08-28 山东中创软件商用中间件股份有限公司 Network topology structure generation method, device, equipment and medium
CN111934921A (en) * 2020-07-29 2020-11-13 深信服科技股份有限公司 Network topology discovery method and device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102420765A (en) * 2011-12-09 2012-04-18 福建星网锐捷网络有限公司 Method and device for determining physical link between switchboard and terminal
CN109150640A (en) * 2018-11-08 2019-01-04 中国电子科技集团公司第二十八研究所 A kind of method for discovering network topology and system based on double layer network agreement
CN110855486A (en) * 2019-11-11 2020-02-28 国网江苏省电力有限公司检修分公司 Topological mapping label-based topological scanning method for station control layer of power secondary system
CN111600762A (en) * 2020-06-02 2020-08-28 山东中创软件商用中间件股份有限公司 Network topology structure generation method, device, equipment and medium
CN111934921A (en) * 2020-07-29 2020-11-13 深信服科技股份有限公司 Network topology discovery method and device, equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117354164A (en) * 2023-12-05 2024-01-05 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure
CN117354164B (en) * 2023-12-05 2024-02-20 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure
CN118394678A (en) * 2024-04-01 2024-07-26 北京壁仞科技开发有限公司 Distributed computing system, PCIe device and method for generating interconnection topology structure information
CN118394678B (en) * 2024-04-01 2024-11-01 北京壁仞科技开发有限公司 Distributed computing system, PCIe device and method for generating interconnection topology structure information

Also Published As

Publication number Publication date
CN112866011B (en) 2023-09-26

Similar Documents

Publication Publication Date Title
CN109150640B (en) Network topology discovery method and system based on two-layer network protocol
CN112953774B (en) Network topology generation method, system, equipment and computer storage medium
CN111600762B (en) Network topology structure generation method, device, equipment and medium
CN112866011B (en) Method, device, equipment and medium for determining network topology structure
CN110858810B (en) Network link state monitoring method, device, system and medium
CN112311571A (en) Network topology generation method and device, electronic equipment and non-transient storage medium
CN114024859B (en) Network topology generation method, storage medium and terminal based on equipment and link discovery
CN115297027B (en) Method, system, storage medium and network management server for identifying links between island network devices
CN113904910A (en) Intelligent asset discovery method and device based on operation and maintenance system
CN110995489B (en) Large data platform server management method, device, server and storage medium
CN110995483B (en) Network topology discovery method and device
CN114465904A (en) Network topology construction method and computing equipment
CN113300880B (en) Ethernet switch topology generation and drawing method based on Tarjan algorithm
CN112039696B (en) Method, device, equipment and medium for generating network topology structure
CN114844821A (en) Network automatic discovery method, device, equipment and storage medium
CN113132233B (en) Data processing method, software defined network controller and data processing system
CN117896191A (en) DPU card powering-on and powering-off method, system, device, equipment and storage medium
CN113014409B (en) Networking equipment configuration method, device, equipment and storage medium
CN115242595B (en) Network device discovery method, device, electronic device and storage medium
CN115865834A (en) Connection relation recognition method, connection relation recognition device, switch, storage medium, and program product
CN112436993B (en) VPN private line discovery method and device based on configuration file analysis
US10158603B2 (en) Efficient storage of network discovery ranges
CN117041062A (en) Network equipment topology discovery method, system and computer storage medium
CN110708208B (en) Monitoring data acquisition method and device, storage medium and terminal
CN107454167A (en) Request processing method and server

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant