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

CN112866011B - 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
CN112866011B
CN112866011B CN202110004185.3A CN202110004185A CN112866011B CN 112866011 B CN112866011 B CN 112866011B CN 202110004185 A CN202110004185 A CN 202110004185A CN 112866011 B CN112866011 B CN 112866011B
Authority
CN
China
Prior art keywords
connection link
connection
equipment
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.)
Active
Application number
CN202110004185.3A
Other languages
Chinese (zh)
Other versions
CN112866011A (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

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 application discloses a network topology structure discovery method, device, equipment and medium. Wherein the method comprises the following steps: acquiring connection information of target equipment in a target network range; the target equipment comprises a switch and an intelligent terminal; carrying out standardized 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 determining the topological structure in 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 application 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
Embodiments of the present application relate to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for determining a network topology.
Background
In the network management process, network topology information is critical for management personnel, and a network topology structure diagram provides a representation form for knowing the global network connection condition. The network manager can grasp the condition of the network as a whole through the network topology structure diagram, so as to correctly plan and configure the equipment in the network. The existing network topology is generally organized by a manager and manually input into a network management system, and the completion of the network topology is realized by utilizing manual configuration addition.
The defects of the scheme are that: when the network scale is large and the topology structure is changed much, the generation of the network topology structure is difficult to be effectively and accurately realized by a manager in a manual configuration mode, and the management efficiency of the network equipment is greatly reduced.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for determining a network topology structure, which can automatically generate the network topology structure according to the connection information of network equipment to be discovered, thereby effectively improving the management efficiency of the network topology structure.
In a first aspect, an embodiment of the present application provides a method for discovering a network topology, including:
acquiring connection information of target equipment in a target network range; the target equipment comprises a switch and an intelligent terminal;
carrying out standardized 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 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, obtaining connection information of the target device within the range of the target network includes:
acquiring an IP address of target equipment in 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, performing standardization 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 the switch and the intelligent terminal, where the method includes:
establishing an equipment initial connection link between every two target equipment within the range of the target network according to the port connection links of the adjacent target equipment;
creating a first storage set according to the association relation between the IP address and the equipment MAC address; creating a second storage set according to the association relation between the port number and the equipment MAC address;
determining a port connection link between at least two switches according to the device initial connection link and the first storage set; and 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.
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 an initial connection device in the initial connection link according to the association relation between the port number and the port MAC address, and searching an IP address of a termination device in the initial connection link of the device from the first storage set so as to carry out information complementation on the initial connection link of the device and obtain a complete connection link of the device;
and carrying out link deduplication processing on the equipment complement 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 association relation between the IP address of the initial connection device and the device MAC address and the association relation between the IP address of the termination connection device and the device MAC address from the first storage set to obtain a third storage set; deleting the association relation between the port number of the initial connection device and the device MAC address and the association relation between the port number of the termination connection device and the device 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 a 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 an initial connection device, taking the intelligent terminal as a termination connection device, and establishing a connection link between the switch and the intelligent terminal.
In a second aspect, an embodiment of the present application provides a network topology discovery apparatus, including:
the information acquisition module is used for acquiring 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 connection link determining module is used for carrying out standardized 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 topology structure determining module is used for determining the 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.
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 acquisition module is specifically configured to:
acquiring an IP address of target equipment in 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 equipment initial connection link between every two target equipments within the target network range according to the port connection links of the adjacent target equipments;
the storage set creation unit is used for creating a first storage set according to the association relation between the IP address and the equipment MAC address; creating a second storage set according to the association 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 an initial connection device in the initial connection link according to the association relation between the port number and the port MAC address, and searching an IP address of a termination device in the initial connection link of the device from the first storage set so as to carry out information complementation on the initial connection link of the device and obtain a complete connection link of the device;
and carrying out link deduplication processing on the equipment complement connection link to obtain a port connection link between at least two switches.
Optionally, the second determining unit includes a device acquisition subunit, a set determining subunit, and a link determining subunit;
the equipment acquisition subunit is used for acquiring initial connection equipment and termination connection equipment of the equipment initial connection link;
a set determining subunit, configured to delete, from the first storage set, an association relationship between the IP address of the start connection device and the device MAC address and an association relationship between the IP address of the end connection device and the device MAC address, to obtain a third storage set; deleting the association relation between the port number of the initial connection device and the device MAC address and the association relation between the port number of the termination connection device and the device 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 a 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 an initial connection device, taking the intelligent terminal as a termination connection device, and establishing a connection link between the switch and the intelligent terminal.
In a third aspect, an embodiment of the present application further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the 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 of the embodiments of the present application.
In a fourth aspect, an embodiment of the present application further provides a computer readable storage medium, where a computer program is stored, where the program when executed by a processor implements a network topology discovery method according to any one of the embodiments of the present application.
The embodiment of the application acquires the connection information of the target equipment in the range of the target network; the target equipment comprises a switch and an intelligent terminal; carrying out standardized 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 determining the topological structure in 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 application 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 flow chart of a method for discovering a network topology according to a first embodiment of the present application;
fig. 2 is a flow chart of a method for discovering a network topology according to a second embodiment of the present application;
fig. 3 is a schematic structural diagram of a network topology discovery apparatus according to a third embodiment of the application;
fig. 4 is a schematic structural diagram of an electronic device in the fourth embodiment.
Detailed Description
The application is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present application are shown in the drawings.
Example 1
Fig. 1 is a flow chart of a network topology discovery method according to a first embodiment of the application. The embodiment can be applied to the situation of quickly finding the connection relation among devices within the network reachable range. The method of the embodiment can be executed by a network topology discovery device, which can be implemented in a hardware/software manner and can be configured in an electronic device. The network topology discovery method according to any embodiment of the present application can be implemented. As shown in fig. 1, the method specifically includes the following steps:
s110, obtaining 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 requiring 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 self basic information of the target device and the information of the interconnected devices. Specifically, the connection information of each target device is stored in MIB (Management Information Base ) for quick lookup directly based on the IP (Internet Protocol, network protocol) address of the target device.
The obtaining the connection information of the target equipment 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 being connected with 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.
And S120, carrying out standardized 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.
In this embodiment, since there is a problem of information missing or information redundancy in the connection information of the target devices, 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 switch is connected with the switch through a port, and the port of the switch is directly connected with the intelligent terminal; in particular, a plurality of connection ports may be included on a switch to enable information to be transmitted indefinitely through a limited number of switches.
S130, determining a topological structure in 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 critical for management personnel, and a network topology structure diagram can provide a representation form for knowing the global network connection condition; the network manager can grasp the condition of the network in an integral way 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 a switch in a connection link between the switch and the intelligent terminal as an initial connection device, and determining a first switch connected with a port of the switch from a port connection link between at least two switches as a termination connection device; or, taking a switch in a connection link between the switch and the intelligent terminal as a termination connection device, and determining a first switch connected with a port of the switch from a port connection link between at least two switches as an initial connection device; and establishing a connection link between the initial connection equipment and the termination connection equipment to obtain a port connection link between at least two switches and a link connection of a connection link between the switch and the intelligent terminal, thereby obtaining a topological structure in the range of the target network.
The embodiment of the application acquires the connection information of the target equipment in the range of the target network; the target equipment comprises a switch and an intelligent terminal; carrying out standardized 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 determining the topological structure in 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 application 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 flow chart of a network topology discovery method in the second embodiment of the application. The present embodiment is further extended and optimized based on the above embodiment, and may be combined with any of the above technical solutions. As shown in fig. 2, the method includes:
s210, obtaining connection information of target equipment in 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 device MAC (Media Access Control ) address (i.e., physical address), multiple ports, and one port corresponds to one port MAC address; if the target device is an intelligent terminal, one intelligent terminal has an IP address, one IP address corresponds to one device MAC address, and the intelligent terminal has no port, and no corresponding port MAC address exists.
Note that the switch in this embodiment may support SNMP (Simple Network Management Protocol ) and LLDP (Link Layer Discovery Protocol, link layer discovery protocol).
S220, establishing device initial connection links between every two target devices in the range of the target network according to the port connection links of the adjacent target devices.
In this embodiment, the device initial connection link is a connection link formed by all target devices within the target network range; since the device initial connection link is obtained by connecting all target devices as initial connection devices, there may be information loss or information redundancy in the device initial connection link, and further processing is required.
Wherein the device initial connection link can be seen in table 1 below.
Table 1 initial connection link table for devices
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 association relation between the IP address and the equipment MAC address; and creating a second storage set according to the association relation between the port number and the device MAC address.
In this embodiment, different connection information of the target device is stored in the first storage set and the second storage set respectively, 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 set of stores can be seen in table 2 below; the second set of stores 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
In table 3, the device MAC corresponding to the port number is the device MAC address of the device whose port number can reach the device; sw1A and sw1B are the A port and the B port of sw1 respectively; sw2A and sw2B are the A port and the B port of sw2 respectively; sw3A and sw3B are the a and B ports of sw3, respectively.
S240, determining a port connection link between at least two switches according to the device initial connection link and the first storage set; and 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.
In this embodiment, the port connection link between two switches is a link between two switches connected through a port; the connection link between the switch and the intelligent terminal is a link of the port of the switch and the intelligent terminal; specifically, the intelligent terminal in this embodiment may be a computer.
According to the method, the device and the system, the connection information of the target devices is classified and stored in the corresponding set, and the connection links between the target devices are effectively determined according to unique matching among different information stored in the set.
S250, determining a topological structure in 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 above embodiment, optionally, obtaining connection information of the target device within the range of the target network includes:
acquiring an IP address of target equipment in a target network range;
based on the network management protocol, the connection information of the target device is determined according to the IP address of the target device.
In this embodiment, based on the network management protocol, determining the connection information of the target device according to the IP address of the target device may include: traversing the IP addresses of all target devices in the range of the target network, and acquiring MIB (i.e. connection information in the embodiment) of the IP addresses through a network management protocol such as SNMP; if the related information of the IP address is not obtained, the IP address is not reachable, namely, the IP address is discarded. By the method, the effective connection information of the target equipment can be directly obtained.
On the basis of the above 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:
according to the association relation between the port number and the port MAC address, determining the port MAC address of the initial connection device in the initial connection link, and searching the IP address of the termination device in the initial connection link of the device from the first storage set so as to carry out information completion on the initial connection link of the device and obtain a complete connection link of the device;
and carrying out link deduplication processing on the device complement connection link to obtain a port connection link between at least two switches.
In this embodiment, since the port MAC address of the initial connection device and the IP address of the terminating connection device are absent in the device initial connection link table, information is required to be complemented on the device initial connection link, and the complemented device complemented connection link can be seen in table 4 below.
Table 4 device full link table
It can be seen that there are two duplicate links in table 4, namely two connection links with port number sw1A and port number sw 2A; namely, two connection links with the port number of sw1B and the port number of sw3A are provided; any link in the repeated links is removed, and one link is reserved; the complexity of the link can be effectively simplified and the unique connectivity of the link can be ensured.
The port connection links between 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, according to the device initial connection link, the first storage set, and the second storage set, a connection link between the switch and the intelligent terminal includes:
acquiring an initial connection device and a termination connection device of an initial connection link of the device;
deleting the association relation between the IP address of the initial connection device and the MAC address of the device and the association 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 association relation between the port number of the initial connection device and the device MAC address and the association relation between the port number of the termination connection device and the device 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, and the initial connection device is switch 1, and the terminating connection devices are switch 2 and switch 3, respectively. The third storage set obtained through the above deletion operation can be referred to table 6; the fourth set of stores can be seen in table 7.
TABLE 6 third storage set table
IP address Device MAC address
192.168.1.4 com1
192.168.1.5 com2
Table 7 fourth stored set table
Port number Device MAC address
sw2B com1
sw3B com2
It can be seen that the own information of the intelligent terminal is reserved in table 6; the intelligent device and connection relationship is retained in table 7. The connection between the intelligent terminal 1 and the port B of the switch 2 can be obtained; 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 switch port can be screened out rapidly.
On the basis of the foregoing embodiment, 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 a device MAC address associated with a port number in a 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 an initial connection device, taking the intelligent terminal as a termination connection device, and establishing a connection link between the switch and the intelligent terminal.
In this embodiment, obtaining, from the third storage set, the IP address of the device MAC address associated with the port number in the fourth storage set, where obtaining the intelligent terminal may include: traversing each port number in the third storage set to obtain the association relation between the port number and the device MAC address of the target device; 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 association relation between the port number and the equipment MAC address in the fourth storage set.
Establishing a connection link between a port of a switch and an intelligent terminal may include: establishing an association relation between the IP address of the switch and the IP address of the intelligent terminal; establishing an association relation between the switch and the port number of the intelligent terminal; and establishing an association relation between the port MAC address of the IP of the switch and the equipment MAC address of the intelligent terminal to obtain a connection link of the switch and the intelligent terminal.
According to the embodiment, the intelligent terminal can be accurately searched according to the association 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 network topology discovery apparatus according to a third embodiment of the present application, which is applicable to a case of quickly discovering connection relationships between devices within a network reachable range. The device is configured in the electronic equipment, and can realize the network topology structure discovery method according to any embodiment of the 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 standardization processing on connection information of the target device, so as to obtain a port connection link between at least two switches and a connection link between the switch and the intelligent terminal;
the topology structure determining module 330 is configured to determine a topology structure within the target network range 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 above 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.
Based on the above embodiment, the optional information obtaining module 310 is specifically configured to:
acquiring an IP address of target equipment in 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 above-described 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 equipment initial connection link between every two target equipments within the target network range according to the port connection links of the adjacent target equipments;
the storage set creation unit is used for creating a first storage set according to the association relation between the IP address and the equipment MAC address; creating a second storage set according to the association 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 above embodiment, optionally, the first determining unit is specifically configured to:
determining a port MAC address of an initial connection device in the initial connection link according to the association relation between the port number and the port MAC address, and searching an IP address of a termination device in the initial connection link of the device from the first storage set so as to carry out information complementation on the initial connection link of the device and obtain a complete connection link of the device;
and carrying out link deduplication processing on the equipment complement connection link to obtain a port connection link between at least two switches.
On the basis of the above embodiment, optionally, the second determining unit includes a device acquisition subunit, a set determining subunit, and a link determining subunit;
the equipment acquisition subunit is used for acquiring initial connection equipment and termination connection equipment of the equipment initial connection link;
a set determining subunit, configured to delete, from the first storage set, an association relationship between the IP address of the start connection device and the device MAC address and an association relationship between the IP address of the end connection device and the device MAC address, to obtain a third storage set; deleting the association relation between the port number of the initial connection device and the device MAC address and the association relation between the port number of the termination connection device and the device 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 above embodiment, optionally, the link determining subunit is specifically configured to:
acquiring an IP address of an equipment MAC address associated with a 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 an initial connection device, taking the intelligent terminal as a termination connection device, and establishing a connection link between the switch and the intelligent terminal.
By the network topology discovery device of the third embodiment of the application, the network topology can be automatically generated according to the connection information between the target devices to be discovered, thereby effectively improving the generation efficiency of the network topology.
The network topology discovery device provided by the embodiment of the application can execute the network topology discovery method provided by any embodiment of the application, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device in a fourth embodiment of the present application, and 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 processors 410 in the electronic device may be one or more, one processor 410 being taken as an example in fig. 4; the processor 410, memory 420, input device 430, and output device 440 in the electronic device may be connected by a bus or other means, for example in fig. 4.
The memory 420 is a computer readable storage medium, and may be used to store a software program, a computer executable program, and modules, such as program instructions/modules corresponding to the network topology discovery method in the embodiment of the present application. The processor 410 executes various functional applications of the electronic device and data processing by running software programs, instructions and modules stored in the memory 420, i.e. implements the network topology discovery method provided by the embodiments of the present application.
Memory 420 may include primarily a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application program required for functionality; the storage data area may store data created according to the use of the terminal, etc. In addition, 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 remotely located relative to processor 410, which may be connected to the electronic device via 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 to generate key signal inputs related to user settings and function control of the electronic device, which may include a keyboard, mouse, etc. The output 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 the network topology discovery method provided by the embodiments of the present application.
Of course, the storage medium containing the computer executable instructions provided in the embodiments of the present application is not limited to the method operations described above, and may also perform the related operations in the network topology discovery method provided in any embodiment of the present application.
From the above description of embodiments, it will be clear to a person skilled in the art that the present application may be implemented by means of software and necessary general purpose hardware, but of course also by means of hardware, although in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, etc., and include several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present application.
It should be noted that, in the above-mentioned embodiments of the search apparatus, each unit and module included are only divided according to the functional logic, but not limited to the above-mentioned division, as long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the present application.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. It will be understood by those skilled in the art that the present application 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 application. Therefore, while the application has been described in connection with the above embodiments, the application is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the application, which is set forth in the following claims.

Claims (7)

1. A method for discovering a network topology, the method comprising:
acquiring connection information of target equipment in a target network range; the target equipment comprises a switch and an intelligent terminal;
carrying out standardized 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;
determining a topological structure in the target network range according to the port connection link between the at least two switches and the connection link between the switch and the intelligent terminal;
the obtaining the connection information of the target device within the range of the target network includes:
acquiring an IP address of target equipment in a target network range;
determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol;
the connection information of the target equipment comprises an incidence relation between an IP address and an equipment MAC address, an incidence relation between a port number and the equipment MAC address, an incidence relation between the port number and the port MAC address and a port connection link of adjacent target equipment;
performing 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 the switch and the intelligent terminal, including:
establishing an equipment initial connection link between every two target equipment within the range of the target network according to the port connection links of the adjacent target equipment;
creating a first storage set according to the association relation between the IP address and the equipment MAC address; creating a second storage set according to the association relation between the port number and the equipment MAC address;
determining a port connection link between at least two switches according to the device initial connection link and the first storage set; and 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.
2. The method of claim 1, wherein determining a port connection link between at least two switches from the device initial connection link and the first stored set comprises:
determining a port MAC address of an initial connection device in the initial connection link according to the association relation between the port number and the port MAC address, and searching an IP address of a termination device in the initial connection link of the device from the first storage set so as to carry out information complementation on the initial connection link of the device and obtain a complete connection link of the device;
and carrying out link deduplication processing on the equipment complement connection link to obtain a port connection link between at least two switches.
3. The method of claim 1, wherein determining a connection link between a switch and an intelligent terminal based on 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 association relation between the IP address of the initial connection device and the device MAC address and the association relation between the IP address of the termination connection device and the device MAC address from the first storage set to obtain a third storage set; deleting the association relation between the port number of the initial connection device and the device MAC address and the association relation between the port number of the termination connection device and the device 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.
4. A method according to claim 3, wherein determining a connection link between a switch and a smart terminal from the third set of stores and the fourth set of stores comprises:
acquiring an IP address of an equipment MAC address associated with a 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 an initial connection device, taking the intelligent terminal as a termination connection device, and establishing a connection link between the switch and the intelligent terminal.
5. A network topology discovery apparatus, the apparatus comprising:
the information acquisition module is used for acquiring 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 connection link determining module is used for carrying out standardized 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;
the topology structure determining module is used for determining 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;
the information acquisition module is specifically configured to:
acquiring an IP address of target equipment in a target network range;
determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol;
the connection information of the target equipment comprises an incidence relation between an IP address and an equipment MAC address, an incidence relation between a port number and the equipment MAC address, an incidence relation between the port number and the port MAC address and a port connection link of adjacent target equipment;
the information acquisition module is specifically configured to:
acquiring an IP address of target equipment in a target network range;
determining the connection information of the target equipment according to the IP address of the target equipment based on a network management protocol;
a connection link establishing unit, configured to establish an equipment initial connection link between every two target equipments within the target network range according to the port connection links of the adjacent target equipments;
the storage set creation unit is used for creating a first storage set according to the association relation between the IP address and the equipment MAC address; creating a second storage set according to the association 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.
6. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs,
when executed by the one or more processors, causes the one or more processors to implement the network topology discovery method of any one of claims 1-4.
7. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements a network topology discovery method according to any one of claims 1 to 4.
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 CN112866011A (en) 2021-05-28
CN112866011B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117354164B (en) * 2023-12-05 2024-02-20 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure
CN118394678B (en) * 2024-04-01 2024-11-01 北京壁仞科技开发有限公司 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

Also Published As

Publication number Publication date
CN112866011A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
RU2375746C2 (en) Method and device for detecting network devices
CN111600762B (en) Network topology structure generation method, device, equipment and medium
CN112953774B (en) Network topology generation method, system, equipment and computer storage medium
CN112866011B (en) Method, device, equipment and medium for determining network topology structure
CN111625419B (en) Log acquisition method, system, equipment and computer readable storage medium
CN110858810B (en) Network link state monitoring method, device, system and medium
CN114024886B (en) Cross-resource-pool network intercommunication method, electronic equipment and readable storage medium
CN109088957B (en) NAT rule management method, device and equipment
CN114024859B (en) Network topology generation method, storage medium and terminal based on equipment and link discovery
CN108833129B (en) Network topology discovery method and device
CN110995489B (en) Large data platform server management method, device, server and storage medium
CN110995483B (en) Network topology discovery method and device
CN115297027B (en) Method, system, storage medium and network management server for identifying links between island network devices
CN114844821A (en) Network automatic discovery method, device, equipment and storage medium
CN112039696B (en) Method, device, equipment and medium for generating network topology structure
CN109104499B (en) Session establishing method, device, equipment and storage medium
US20210377718A1 (en) Pattern affinity for discovery
CN113783755A (en) Network monitoring method, network monitoring device, storage medium and electronic device
CN113347268A (en) Networking method and device based on distributed network, storage medium and computer equipment
CN115242595B (en) Network device discovery method, device, electronic device and storage medium
CN117424848B (en) Node call optimization method, system, equipment and medium based on machine learning
CN112383480B (en) Flow table processing method and device, monitoring device and storage medium
CN114189426A (en) Proxy service adaptive band configuration reply method, system, device and storage medium
CN117896191A (en) DPU card powering-on and powering-off method, system, device, equipment and storage medium
CN115865834A (en) Connection relation recognition method, connection relation recognition device, switch, storage medium, and program product

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