A method, system and storage medium for automatically discovering network devices

CN115695204BActive Publication Date: 2025-01-10HUNAN TIANGUAN ELECTRONICS INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211229281.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-09
Publication Date
2025-01-10
Estimated Expiration
2042-10-09

AI Technical Summary

Technical Problem

[0002]目前市场上的网管平台实现网络拓扑,主要是通过LLDP(Link Layer DiscoveryProtocol,链路层发现协议)来实现邻居关系,但这种协议只能在数据链路层对设备进行发现,无法发现数据链路层以上的设备,包括路由器、无线路由器、AC\AP、网关、服务器、监控等网络层及以上设备

Benefits of technology

[0032] The method for automatically discovering network devices provided by the present invention includes: the first device uses a set private protocol NTTDP message to obtain the data information and connection status of the second device connected to itself; the port where the first device connects to the second device . Report the data information of the second device to the network management server. In this way, the device uses the private protocol NTTDP message method to obtain the data information and connection status of the peer device directly connected to it, and uses detection and response methods to interact. When a device obtains the information of the device connected to it, Reported to the network management server, the network management server forms a network topology diagram, which can automatically discover the connections of all network devices in the entire intranet and form a complete network topology diagram.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115695204B_ABST
    Figure CN115695204B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data communication technology, and discloses a method, system and storage medium for automatically discovering network devices. The method includes: a first device uses a private protocol NTTDP message to obtain data information and connection status of a second device connected to itself; the first device reports the port connected to the second device and the data information of the second device to a network management server. In this way, the device uses a private protocol NTTDP message to obtain data information and connection status of the opposite device directly connected to itself, and uses a detection and response method to interact. When a device obtains the device information connected to it, it reports it to the network management server, and the network management server forms a network topology map, which can automatically discover all network device connections in the entire intranet and form a complete network topology map.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data communication technology, and in particular to a method, system and storage medium for automatically discovering network devices. Background Art

[0002] The network management platforms currently on the market implement network topology mainly through LLDP (Link Layer Discovery Protocol) to achieve neighbor relationships, but this protocol can only discover devices at the data link layer, and cannot discover devices above the data link layer, including routers, wireless routers, AC\AP, gateways, servers, monitoring and other network layer and above devices. Therefore, the network device topology map implemented by the current network management platforms on the market can only draw topology maps for managed switches. In the era of rapid development of the Internet of Things, there is an urgent need for a network management platform that can realize automatic discovery of all network device connections in the entire intranet and form a complete network topology map. Summary of the invention

[0003] The present invention provides a method, system and storage medium for automatically discovering network devices, so as to realize automatic discovery of all network device connections in the entire intranet and form a complete network topology map.

[0004] In order to achieve the above object, the present invention is implemented by the following technical solutions:

[0005] In a first aspect, the present invention provides a method for automatically discovering a network device, comprising:

[0006] The first device uses a private protocol NTTDP message to obtain data information and connection status of the second device connected to itself;

[0007] The first device reports the port connected to the second device and the data information of the second device to the network management server.

[0008] Optionally, the private protocol NTTDP message includes an MD message, a HO message and a RR message;

[0009] The MD message is used to exchange information with adjacent network management devices and report neighbor relationship status to the network management server;

[0010] The HO message is used to detect whether there is a relay device that does not support the private protocol NTTDP between two devices that support the private protocol NTTDP. If so, it is reported to the network management server;

[0011] The RR message is used to form a network topology diagram and a non-NTTDP connection relationship when the device uplink port is connected to a non-NTTDP device, and to establish a connection relationship diagram between the uplink port and the nearest NTTDP-supporting device.

[0012] Optionally, the first device uses a private protocol NTTDP message to obtain data information of a second device connected to itself, including:

[0013] The first device sends an MD message without encapsulating data information of the first device to all ports in the network;

[0014] The second device receives the MD message, redirects the message to the CPU based on the MD message, and extracts message data information in the MD message, where the message data information includes a message type;

[0015] In response to the MD message, the second device returns a response MD message to the first device, where the response MD message includes data information of the second device;

[0016] The first device receives the response MD message, redirects to the CPU based on the response MD message, and extracts data information of the second device in the response MD message;

[0017] The first device sends an MD message encapsulating data information of the first device to the port connected to the second device;

[0018] The second device extracts the data information of the first device from the MD message encapsulating the data information of the first device, and reports the port connected to the first device and the data information of the first device to the network management server.

[0019] Optionally, when the port connected to the first device is disconnected, the first device clears data of the disconnected port, generates a disconnection event for the port, and reports the disconnection event to the network management server;

[0020] The network management server deletes the data connection information of other devices associated with the disconnected port of the first device, and sends an update event message to the associated devices connected to the disconnected port;

[0021] The associated device deletes the first device associated with its own port and the binding information of the disconnected port, and notifies the network management server;

[0022] The network management server updates the network topology diagram.

[0023] Optionally, the method further comprises:

[0024] When the first device sends an MD message to port N and the first device does not receive a response from port N, the processing method includes the following, where port N is any port in the network:

[0025] Method 1: If port N is not a gateway port or a router port, check the number of MAC addresses of port N. If the number of MAC addresses is less than or equal to 1, it is considered that port N is connected to a host terminal. If the number of MAC addresses is greater than 1, it is considered that port N is connected to a switch, and the switch is connected to multiple host terminals.

[0026] Method 2: If port N is a default gateway port or a routing port, send an RR message to determine the status of the node that is closest to the port N for data communication.

[0027] Optionally, the method further comprises:

[0028] If there is a switch that does not support the NTTDP protocol between two devices that support the NTTDP protocol at the same time, a relay device that does not support the NTTDP protocol is drawn in the topology diagram. After one of the devices establishes a connection with the other device by sending an NTTDP protocol message to port N, it still needs to send an HO message to determine whether there is a relay device between the two devices, and report the information on whether there is a relay device to the network management server, where port N is any port in the network.

[0029] In a second aspect, the present application provides a system for automatically discovering network devices, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0030] In a third aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method steps described in the first aspect.

[0031] Beneficial effects:

[0032] The method for automatically discovering network devices provided by the present invention includes: the first device uses a private protocol NTTDP message to obtain data information and connection status of a second device connected to itself; the first device reports the port connected to the second device and the data information of the second device to the network management server. In this way, the device uses the private protocol NTTDP message method to obtain data information and connection status of the opposite device directly connected to itself, and uses the detection and response method to interact. When a device obtains the device information connected to it, it reports it to the network management server, and the network management server forms a network topology map, which can automatically discover all network device connections in the entire intranet and form a complete network topology map. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flowchart of a method for automatically discovering network devices according to a preferred embodiment of the present invention;

[0034] Figure 2 This is a schematic diagram of the MD message definition format according to a preferred embodiment of the present invention;

[0035] Figure 3 A schematic diagram of the HO message definition format according to a preferred embodiment of the present invention;

[0036] Figure 4 A schematic diagram of the RR message definition format according to a preferred embodiment of the present invention;

[0037] Figure 5 A LINKUP event flow chart of a preferred embodiment of the present invention;

[0038] Figure 6 A LINKDOWN event flow chart of a preferred embodiment of the present invention;

[0039] Figure 7 A schematic diagram of detecting leaf nodes and routing relay nodes according to a preferred embodiment of the present invention;

[0040] Figure 8 A schematic diagram of the nearest connection node for data communication according to a preferred embodiment of the present invention;

[0041] Fig. 9 This is a flow chart of NTTDP timeout processing events in a preferred embodiment of the present invention. DETAILED DESCRIPTION

[0042] The technical solution of the present invention is described clearly and completely below. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0043] Unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the usual meanings understood by persons with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, words such as "one" or "one" do not indicate quantity restrictions, but indicate the existence of at least one. Words such as "connect" or "connected" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the object being described changes, the relative positional relationship also changes accordingly.

[0044] It should be understood that NTTDP (Network Things Topology Discovery Protocol), which is any network device topology automatic discovery protocol, is a communication protocol for network topology formation. Through this protocol, switches, wireless routers, AC / AP, 5G routers, IoT gateways and other devices can automatically discover their neighbor connection devices and report them to the network management platform, eventually forming a complete internal network device connection relationship topology map. Through the NTTDP protocol of the present invention, the mutual connection relationship of intranet network devices in enterprises, government enterprises and other units can be automatically discovered and reported to the network management server to generate a network topology map. The NTTDP protocol method of the present invention can not only realize the topology map generation for managed switches, but also realize the topology connection relationship map generation for network devices such as wireless routers, 5G\4G gateways, and unmanaged switches.

[0045] The method for automatically discovering network devices provided in the embodiment of the present application is operated in the intranet and cannot cross the Internet, but can cross VPN. Most applications are deployed in the intranet in the network management server. If the network management server is deployed in the cloud, or the applicant provides the server to the user, the network topology needs to be formed according to the enterprise or unit, and unitization is required, and the network topology database of each enterprise or unit is independent.

[0046] A method for automatically discovering network devices provided in an embodiment of the present application is applied to an intranet system, where the intranet system may include multiple node devices and ports for communication between the node devices. The specific process of the method is as follows:

[0047] See also Figure 1 , the present application embodiment provides a method for automatically discovering network devices, including:

[0048] The first device uses a private protocol NTTDP message to obtain data information and connection status of the second device connected to itself;

[0049] The first device reports the port connected to the second device and the data information of the second device to the network management server.

[0050] In the above-mentioned method of automatically discovering network devices, the device uses the private protocol NTTDP message method to obtain the data information and connection status of the opposite device directly connected to itself, and uses the detection and response method to interact. When a device obtains the device information connected to it, it reports it to the network management server, and the network management server forms a network topology map. It can automatically discover all network device connections in the entire intranet and form a complete network topology map.

[0051] It should be noted that NTTDP protocol messages must be redirected to the CPU on devices that support the network management platform and cannot be forwarded or broadcast to other ports. If it is a dumb switch, a third-party switch or other network device that does not support the NTTDP protocol, it will broadcast the NTTDP protocol MD (multicast Detect) message, but will discard the NTTDP protocol HO (Hit own) message. If the device routing port is connected to a device that does not support the NTTDP protocol, it will send a protocol RR (Root Router) message to the root node in the network topology to find the nearest node that supports NTTDP.

[0052] Optionally, the private protocol NTTDP message includes an MD message, a HO message and a RR message;

[0053] The MD message is used to exchange information with adjacent network management devices and report neighbor relationship status to the network management server;

[0054] The HO message is used to detect whether there is a relay device that does not support the private protocol NTTDP between two devices that support the private protocol NTTDP. If so, it is reported to the network management server;

[0055] The RR message is used to form a network topology diagram and a non-NTTDP connection relationship when the device uplink port is connected to a non-NTTDP device, and to establish a connection relationship diagram between the uplink port and the nearest NTTDP-supporting device.

[0056] In this optional implementation, the private protocol message data encapsulation uses a checksum to ensure data correctness. The data can also be encrypted to ensure data security. There are three main types of protocol messages:

[0057] 1) MD message, mainly used to exchange information with adjacent network management devices (supporting NTTDP) and report neighbor relationship status to the network management platform. MD message types are divided into three types: request, reply, and ack. The definition format of MD message is as follows Figure 2 As shown in the figure, the MD message meets the ACL matching protocol rule: tcp+dstIP+srcIP+L4Dport.

[0058] 2) HO message, mainly used to detect whether there is non-managed network equipment or management equipment of other companies that do not support NTTDP protocol between two NTTDPs. If there is, it will be reported to the network management platform. HO message types are divided into request and reply. The definition format of HO message is as follows Figure 3 As shown, the HO message meets the ACL matching protocol rule: tcp+dstIP+srcIP+L4Dport.

[0059] 3) RR message, mainly when the device uplink port is connected to a non-NTTDP device, usually the default gateway egress port, or the next-hop routing port, to form a network topology diagram and a non-NTTDP connection relationship, and to establish a connection relationship diagram between the uplink port and the nearest NTTDP support. The current device must be configured with a default gateway. Generally, devices that support network management have a default gateway, and the ARP table of the gateway address must exist. RR message types are divided into two types: request and reply. If the egress port of the request repuset is the default gateway egress, fill in the root node ip in dst-ip. If the egress port is only a routing port, fill in the next-hop routing address in dst-ip. The reply is based on the requesting end ip, and the destination MAC of the message is filled in as the IP gateway address of this address segment, and the dst-ip is the requesting end ip. The RR message definition format is as follows Figure 4 As shown, the RR message meets the ACL matching protocol rule: tcp+L4SPort+L4Dport.

[0060] In some specific examples below, the method for automatically discovering network devices is described in detail by taking the first device as device A and the second device as device B as an example. Figure 5 As shown, this embodiment specifically provides the specific steps for device A and device B to perform a LINKUP event:

[0061] After the system is powered on and stabilized, device A sends NTTDP protocol messages to all up ports. Port linkdown->linkup also sends NTTDP protocol messages to the LINK change connection port.

[0062] Device A sends an MD message without encapsulating the data information of the first device to all ports in the network. Here, it should be noted that the device does not know whether the device connected to it is an NTTDP device at the beginning, and uses broadcasting to detect. Therefore, it is sent to all ports in the network. If the device supports NTTDP, it will respond after receiving the message.

[0063] Device B receives the MD message, redirects (i.e., forcibly forwards) the MD message to the CPU, and extracts message data information in the MD message, where the message data information includes a message type.

[0064] Device B responds to the MD message and returns a reply MD message to device A, where the reply MD message includes data information of device B;

[0065] Device A receives the reply MD message, redirects it to the CPU based on the reply MD message, and extracts the data information of device B in the reply MD message; reports the port connected to device B and the data information of device B (basic information of device B, entry, sending TX, receiving RX, etc.) to the network management server;

[0066] Device A sends an MD message encapsulated with device A's data information to the port connected to device B;

[0067] Device B extracts the data information of device A from the MD message encapsulating the data information of device A, and reports the port connected to device A and the data information of device A (basic information of device A, entry, sending TX, receiving RX, etc.) to the network management server.

[0068] In this way, the specific steps of performing the LINKUP event between device A and device B are implemented.

[0069] In this embodiment, the MD message of the data information of the first device is not encapsulated first, because the first device will broadcast to all ports, and carrying the device information out will be easily stolen illegally by hackers, which poses a security risk. Only when a trust relationship is established between each other can information be exchanged with each other.

[0070] Below, as Figure 6 As shown, the specific steps of device A and device B performing a LINKDOWN event are described. It should be noted that in this application, port N and port M are both non-specific ports. They are both used to represent ports connected to device A or connected to device B.

[0071] Optionally, when the port connected to the first device is disconnected (linkdown), the first device clears data of the disconnected port, generates a connection disconnection event for the port, and reports the connection disconnection event to the network management server;

[0072] The network management server deletes the data connection information of other devices associated with the disconnected port of the first device, and sends an update event message to the associated devices connected to the disconnected port;

[0073] The associated device deletes the first device associated with its own port and the binding information of the disconnected port, and notifies the network management server;

[0074] The network management server updates the network topology diagram.

[0075] In this optional implementation, port N connected to device A is disconnected, device A deletes the node device information associated with port N, and reports a LINKDOWN event of port N disconnection. The network management server deletes the node device information associated with port N connected to device A, and notifies device B that has been associated with port N about the port N disconnection event. Device B receives the message from the network management server, searches for the data recorded by port N connected to device A on its own, and deletes the data if relevant data is found. If not found, no processing is performed. Then, device B reports to the network management server to notify device A to clear the port associated with device B and device A, as well as the node information bound to the port. After receiving the message, the gateway server clears the corresponding data and updates the network topology map.

[0076] Below, as Figure 7 As shown, an example is given for the detection of leaf nodes and routing relay nodes when automatically discovering network devices. First of all, it should be explained that the definition of the end node (leaf node) is that the end node refers to an NTTDP node device with a port that is LINKUP, but this port has not received any NTTDP protocol message. The device connected to this port is generally a terminal host device such as a PC and a camera. If there are more than two host MAC addresses under this port, then this port is connected to a fool switch or other switch that does not support NTTDP, and the terminal host is connected to the switch. The definition of a relay node is that there is a switching device between two NTTDP nodes, and this device does not support NTTDP. Generally, the existence of an NTTDP node can be determined by the HO message. If a port receives multiple different NTTDP-MD messages, it can also be determined that a relay node device is hung. The relay node device cannot establish a connection with the network management server, so the network manager needs to manually configure the device information.

[0077] Optionally, the method further comprises:

[0078] When the first device sends an MD message to port N and the first device does not receive a response from port N, the processing method includes the following, where port N is any port in the network:

[0079] Method 1: If port N is not a gateway port or a router port, check the number of MAC addresses of port N. If the number of MAC addresses is less than or equal to 1, it is considered that port N is connected to a host terminal. If the number of MAC addresses is greater than 1, it is considered that port N is connected to a switch, and the switch is connected to multiple host terminals.

[0080] Method 2: If port N is a default gateway port or a routing port, send an RR message to determine the status of the node that is closest to the port N for data communication.

[0081] In this way, the leaf node and routing relay node detection steps are implemented.

[0082] It should be noted that the nearest connection node for data communication is, for example, Figure 8 As shown, if Figure 8 In the example, NTTDP node device 5 is the root node, and port N of NTTDP node device 1 is an uplink port or routing port. The device directly connected to port N does not support NTTDP. It is necessary to find the NTTDP device closest to port N through non-NTTDP devices. Figure 8 As shown, the nearest device should be NTTDP node device 4.

[0083] Below, as Fig. 9 As shown in the figure, the NTTDP timeout processing event is explained:

[0084] Optionally, the method also includes: if there is a switch that does not support the NTTDP protocol between two devices that simultaneously support the NTTDP protocol, a relay device that does not support the NTTDP protocol is drawn in the topology diagram. After one of the devices establishes a connection relationship with the other device by sending an NTTDP protocol message to port N, it is still necessary to send an HO message to determine whether there is a relay device between the two devices, and report the information on whether there is a relay device to the network management server, where port N is any port in the network.

[0085] The above-mentioned method of automatically discovering network devices is generally applied to the intranet of an enterprise or unit to uniformly manage and maintain the intranet devices.

[0086] The present application also provides a system for automatically discovering network devices, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program. The system for automatically discovering network devices can implement various embodiments of the above method for automatically discovering network devices, and can achieve the same beneficial effects, which will not be described in detail here.

[0087] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the method steps described above are implemented. The computer-readable storage medium can implement various embodiments of the method for automatically discovering network devices described above, and can achieve the same beneficial effects, which will not be described in detail here.

[0088] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. A method for automatically discovering network devices, characterized in that: include: The first device uses a private protocol NTTDP message to obtain data information and connection status of a second device connected to itself; the first device reports the port connected to the second device and the data information of the second device to the network management server, and the private protocol NTTDP message includes an MD message, a HO message, and an RR message; the MD message is used to exchange information with adjacent network management devices and report neighbor relationship status to the network management server; the HO message is used to detect whether there is a relay device that does not support the private protocol NTTDP between two devices that support the private protocol NTTDP, and if so, it is reported to the network management server; the RR message is used to form a network topology diagram and a non-NTTDP connection relationship when the device uplink port is connected to a non-NTTDP device, and establish a connection relationship diagram between the uplink port and the nearest device that supports NTTDP. The first device uses a private protocol NTTDP message to obtain the data information and connection status of the second device connected to itself The data information of the second device includes: the first device sends an MD message that does not encapsulate the data information of the first device to all ports in the network; the second device receives the MD message, redirects to the CPU based on the MD message, and extracts the message data information in the MD message, and the message data information includes the message type; the second device responds to the MD message and returns a reply MD message to the first device, and the reply MD message includes the data information of the second device; the first device receives the reply MD message, redirects to the CPU based on the reply MD message, and extracts the data information of the second device in the reply MD message; the first device sends the MD message encapsulated with the data information of the first device to the port connected to the second device; the second device extracts the data information of the first device in the MD message encapsulated with the data information of the first device, and reports the port connected to the first device and the data information of the first device to the network management server.

2. The method for automatically discovering network devices according to claim 1, characterized in that: When the port connected to the first device is disconnected, the first device clears the data of the disconnected port, generates a disconnection event of the port, and reports the disconnection event to the network management server; The network management server deletes the data connection information of other devices associated with the disconnected port of the first device, and sends an update event message to the associated devices connected to the disconnected port; The associated device deletes the first device associated with its own port and the binding information of the disconnected port, and notifies the network management server; The network management server updates the network topology diagram.

3. The method for automatically discovering network devices according to claim 1, characterized in that: The method also includes: when the first device sends an MD message to port N and the first device does not receive a response from port N, the processing method includes the following, wherein port N is any port in the network: Method 1: If port N is a non-gateway port or a non-routing port, check the number of MAC addresses of port N. When the number of MAC addresses is less than or equal to 1, it is considered that port N is connected to a host terminal; when the number of MAC addresses is greater than 1, it is considered that port N is connected to a switch, and the switch is connected to multiple host terminals; Method 2: If port N is a default gateway port or a routing port, send an RR message to determine the situation of the node closest to the data communication with port N.

4. The method for automatically discovering network devices according to claim 1, characterized in that: The method also includes: if there is a switch that does not support the NTTDP protocol between two devices that support the NTTDP protocol at the same time, a relay device that does not support the NTTDP protocol is drawn in the topology diagram. After one of the devices establishes a connection relationship with the other device by sending an NTTDP protocol message to port N, it is still necessary to send an HO message to determine whether there is a relay device between the two devices, and report the information on whether there is a relay device to the network management server, wherein port N is any port in the network.

5. A system for automatically discovering network devices, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 4 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method steps as claimed in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Topology discovery method and system based on SNMP

    CN111565117A