A method and system for cross-subnet device discovery
By adding network segment IP addresses to the UI and using a sniffer to select network segment proxy devices, and employing a combination of UDP unicast and multicast methods, the device discovery problem in multi-network segment environments is solved. This enables automatic discovery and management of cross-network segment devices, improves device deployment and maintenance efficiency, and provides flexibility and scalability.
Patent Information
- Application Number
- CN202310406338.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-04-17
AI Technical Summary
In multi-segment network environments, existing technologies struggle to discover devices, leading to inefficient device management. Furthermore, the isolation inherent in multicast communication limits the application of device discovery methods.
By adding network segment IP addresses to the UI, a sniffer is used to select network segment proxy devices. Cross-network segment device discovery is performed using a combination of UDP unicast and multicast, including device sniffing, unicast command sending, multicast response reception, and response display.
It enables automatic discovery and management of devices across network segments, improves the efficiency of device deployment and maintenance, keeps network data clean, and has flexibility and scalability, supporting remote management and maintenance operations.
Smart Images

Figure CN116405400B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a method and system for discovering devices across network segments. Background Technology
[0002] With the advancement of campus informatization and the development of modern information science and technology, more and more network terminal devices (such as network central control systems and IoT gateways) are being applied in campus scenarios. How to help schools efficiently manage and maintain the terminal devices deployed on campus has become one of the important services offered by terminal vendors. The first step in the management and maintenance of network terminal devices is usually to implement the "device discovery" function.
[0003] From a network technology perspective, devices within a single network segment can directly access and communicate without obstacles. Therefore, device discovery methods within a single network are relatively simple and easy to implement; for example, UDP multicast sniffing can quickly achieve device discovery within the same network. However, considering network security, flexible network management, and different campus application scenarios, multiple network segments often exist within the same campus space, or even a single classroom space. Network terminals thus operate in different network segment environments, and multicast communication is isolated. In this network environment, the "device discovery" methods used in a single network become limited or even unusable. Summary of the Invention
[0004] The purpose of this invention is to provide a method and system for discovering cross-network segment devices, thereby solving the aforementioned problems existing in the prior art.
[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0006] A method for discovering devices across network segments, including,
[0007] S1. Add the IP addresses of the network segments that need to be discovered across network segments to the UI;
[0008] S2. Use a sniffer to sniff devices across specified network segments and select one terminal device from each network segment as the corresponding network segment proxy device.
[0009] S3. Based on the identified network segment proxy devices, automatically discover cross-network segment devices using a sniffer. S3 specifically includes the following steps.
[0010] S31. After selecting a network segment proxy device, the Sniffer sends a UDP unicast command to the network segment proxy device to perform device discovery.
[0011] S32, the network segment agent device receives the UDP unicast command with the 'device discovery subcommand' sent by the Sniffer, records the IP address of the Sniffer, and returns the command processing result to the Sniffer; at the same time, the 'device discovery subcommand' is extracted and forwarded through network group multicast;
[0012] S33, in the same network segment, the non-network segment agent device receives the device discovery command sent by the network segment agent device through group multicast, and returns the response to the 'device discovery subcommand' through a specific group multicast address and port number through group multicast;
[0013] S34, the network segment agent device listens to the specific group multicast address and port to receive the UDP group multicast response packet sent by other devices in the same network segment, and forwards the response packet to the Sniffer in the form of UDP unicast;
[0014] S35, after the Sniffer receives and analyzes the UDP unicast response with 'device discovery response' returned by the network segment agent device, the discovered devices in each network segment are displayed on the UI.
[0015] Preferably, step S1 is specifically adding the IP address and subnet mask of the network segment involved in the cross-network segment device discovery operation configured manually on the UI according to the network segment division.
[0016] Preferably, step S2 is specifically using the Sniffer to perform device sniffing on the cross-network segment, and selecting one terminal device from the terminal devices sniffed in each network segment as the network segment agent device of the corresponding network segment; or directly specifying one terminal device in each network segment as the network segment agent device of the corresponding network segment.
[0017] Preferably, the Sniffer is used to perform device sniffing on the cross-network segment, and one terminal device is selected from the terminal devices sniffed as the network segment agent device, which specifically includes the following contents,
[0018] S21, according to the configured cross-network segment IP list, the Sniffer traverses the valid IP on each network segment, that is, by traversing the sending of UDP unicast sniffing packet, according to whether the device in the specified network segment receives and responds to the UDP unicast sniffing packet sent by the Sniffer, it is determined whether there is a device in the specified network segment;
[0019] S22, if there is a device in the specified network segment, the Sniffer specifies the IP address of the agent device in the network segment according to the agent selection strategy, and determines the network segment agent device.
[0020] Preferably, the terminal device starts a timer when it is first selected as a network segment proxy device, and if the terminal device does not receive the sent out UDP unicast command again within a specified timer timeout period, it is considered that the proxy function is cancelled and it no longer forwards the multicast data sent by other devices in the network segment.
[0021] The present application also aims to provide a cross-network segment device discovery system, which implements cross-network segment device discovery by using any of the above methods, and comprises a Sniffer and a plurality of terminal devices, the Sniffer and the terminal devices being in different network segments.
[0022] The present application has the following advantages: 1. The method of device discovery based on UDP multicast in a single network is extended and compatible, effectively solving the limitations of the device discovery method in a single network segment; further, the device discovery of the whole network can be easily completed without changing the network location of the platform software running, which greatly improves the efficiency of terminal device deployment and maintenance; 2. The cross-network segment device discovery method is simple and easy to implement, and the message has strong expansibility, i.e. it can be quickly expanded on the basis of the cross-network segment device discovery process, which brings great flexibility and possibility for providing more rich applications and customized applications; 3. The device end only responds when the Sniffer sends discovery messages or operation and maintenance messages, and remains silent in other cases, which does not send too many multicast packet data to the network, greatly maintaining the cleanliness of network data. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 is a principle diagram of the system for implementing cross-network segment device discovery in the embodiment one of the present application;
[0024] Figure 2 is a schematic diagram of the system for implementing cross-network segment device discovery in the embodiment two of the present application; DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0026] Embodiment one
[0027] As Figure 1As shown, in the embodiment, a cross-segment device discovery method and system are provided, wherein the system includes a Sniffer and a plurality of terminal devices, the Sniffer (PC device discovery and management software) and the terminal devices are in different network segments; the Sniffer can provide cross-segment device discovery settings, network segment proxy device selection, cross-segment device automatic search and presentation, and configuration of specified discovery devices. The system uses a cross-segment device discovery method to achieve cross-segment device discovery, which specifically includes three parts, which are
[0028] I. Network IP address addition
[0029] This part corresponds to step S1: adding the network IP address of the network segment that needs to be operated on the UI. Specifically, according to the network segment division of the network, manually add the IP address and subnet mask of the network segment involved in the cross-segment device discovery operation on the UI.
[0030] II. Proxy device determination
[0031] This part corresponds to step S2: using Sniffer to sniff the devices of the specified cross-segment, and selecting one terminal device from each network segment as the network segment proxy device of the corresponding network segment.
[0032] Specifically, using Sniffer to sniff the devices of the cross-segment, and selecting one terminal device from the terminal devices of each network segment sniffed as the network segment proxy device of the corresponding network segment; or directly specifying one terminal device in each network segment as the network segment proxy device of the corresponding network segment. That is, the determination of the network segment proxy device includes two ways, which are,
[0033] 1. Sniffer sniffing to determine the network segment proxy device
[0034] (1) According to the configured cross-segment IP list, Sniffer traverses the valid IP on each network segment, that is, by traversing the sending of UDP unicast sniffing packets, according to whether the device in the network segment receives and responds to the UDP unicast sniffing packet sent by Sniffer, to determine whether there is a device in the specified network segment;
[0035] (2) If there is a device in the specified network segment, Sniffer specifies the IP address of the proxy device in the network segment (i.e. selects the network segment proxy device) according to the "proxy selection strategy" to determine the network segment proxy device. In the embodiment, the 'proxy selection strategy' is not fixedly limited, for example, Sniffer can automatically select the first device that returns a unicast sniffing response in the network segment as the network segment proxy device.
[0036] 2. Directly specifying the network segment proxy device
[0037] Directly designate the network segment agent device in each network segment, and the Sniffer searches and discovers the devices in each network segment through the network segment agent device.
[0038] III. Cross-network segment automatic discovery
[0039] This part corresponds to step S3: based on the determined network segment agent device, the Sniffer performs cross-network segment automatic discovery;
[0040] Specifically, the following steps are included
[0041] 1. After selecting the network segment agent device, the Sniffer sends a UDP unicast command to the network segment agent device for device discovery;
[0042] 2. The network segment agent device receives the UDP unicast command with the 'device discovery subcommand' sent by the Sniffer, records the IP address of the Sniffer, and returns the command processing result to the Sniffer; at the same time, the 'device discovery subcommand' is extracted and forwarded through network multicast;
[0043] 3. In the same network segment, the non-network segment agent device receives the device discovery command sent by the network segment agent device through multicast, and returns the response to the 'device discovery subcommand' through a specific multicast address and port number through multicast;
[0044] 4. The network segment agent device listens to the specific multicast address and port to receive the UDP multicast response data packet sent by other devices in the same network segment, and forwards the response packet to the Sniffer in UDP unicast mode;
[0045] 5. After the Sniffer receives and analyzes the UDP unicast response with 'device discovery response' returned by the network segment agent device, the discovered devices in each network segment are displayed on the UI.
[0046] In this embodiment, in order to effectively maintain the device agent mechanism, when a terminal device is first selected as a network segment agent device, a timer is started. If the terminal device does not receive the sent UDP unicast command within the specified timer timeout period, it is considered that the agent function is cancelled and it will no longer forward the multicast data sent by other devices in the network segment.
[0047] In this embodiment, based on the above device automatic discovery process, the Sniffer side can quickly implement other maintenance operations such as device information configuration.
[0048] The system can realize full-network search and presentation of terminal devices (such as central control devices and gateway devices) supporting device search functions without modifying the network position where the system runs. The system also supports remote management and maintenance of the searched terminal devices, such as IP address configuration information modification, upgrade and other operation and maintenance operations.
[0049] Embodiment Two
[0050] As shown in Figure 2 , in this embodiment, a typical topology scenario is provided in which a terminal device and a Sniffer run in different network segments (the Sniffer runs in network segment 1, and the classroom 1 central control and the classroom 2 central control run in network segment 2). The Sniffer software adopts the golang language to implement the UDP message protocol and the UI human-computer interaction interface in the method of the present application, and the central control device needs to support the network segment proxy and the network segment internal multicast application protocol in the method of the present application. The specific message format and command values are not limited here.
[0051] The specific process of the system to realize cross-network segment device discovery is as follows:
[0052] I. Network segment IP address addition
[0053] The Sniffer adds the network address of network segment 2 and its subnet mask on the UI.
[0054] II. Proxy device determination
[0055] According to the network address of network segment 2, the Sniffer traverses the valid IP on network segment 2, that is, by traversing to send a UDP unicast sniffing packet. The classroom 1 central control device and the classroom 2 central control device have successively received and responded to the unicast sniffing command sent by the Sniffer.
[0056] The Sniffer selects the classroom 1 central control device sniffed in network segment 2 as the proxy device according to the proxy strategy.
[0057] III. Cross-network segment automatic discovery
[0058] 1. The Sniffer in network segment 1 sends a UDP unicast command (the command encapsulates a device discovery subcommand) to the 'classroom 1 central control device' in network segment 2 for device discovery.
[0059] 2. The 'classroom 1 central control device' in network segment 2 receives the UDP unicast command with the 'device discovery subcommand' sent by the Sniffer in network segment 1 (which indicates that it has been selected as a network segment device proxy), records the IP address of the Sniffer, and returns the command processing result to the Sniffer; secondly, the 'classroom 1 central control device' extracts the 'device discovery subcommand' and forwards the device discovery subcommand through multicast. At the same time, a timer is started for proxy keep-alive detection.
[0060] 3. Within network segment 2, after the non-agent device 'Classroom 2 Central Control Device' receives the device discovery command sent by 'Classroom 1 Central Control Device' via multicast, it also returns a response to the device discovery sub-command via multicast.
[0061] 4. After receiving the UDP multicast response from the 'Classroom 1 Central Control Device' in the network segment, the 'Classroom 1 Central Control Device' then forwards the response to the Sniffer in the network segment 1 via UDP unicast.
[0062] 5. After receiving and parsing the UDP unicast response with the 'Device Discovery Response' returned by the 'Classroom 1 Central Control Device', the Sniffer displays the discovered 'Classroom 1 Central Control Device' and 'Classroom 2 Central Control Device' on the UI.
[0063] In this embodiment, after the Sniffer completes the discovery of devices in network segment 2, it can further perform specific deployment or maintenance operations on the discovered 'Classroom 2 Central Control Device'.
[0064] By adopting the above-disclosed technical solution of this invention, the following beneficial effects are obtained:
[0065] This invention provides a cross-network segment device discovery method and system, extending compatibility with methods for device discovery based on UDP multicast within a single network, effectively overcoming the limitations of single-network segment device discovery methods. Furthermore, it allows for easy discovery of devices across the entire network without changing the network location where the platform software operates, significantly improving the efficiency of terminal device deployment and maintenance. The cross-network segment device discovery method is simple to implement and its messages have strong scalability, meaning it can rapidly extend the protocol based on the cross-network segment device discovery process, bringing great flexibility and possibilities for providing richer and customized applications. The device only responds when a discovery message or maintenance message is sent by a sniffer; otherwise, it remains silent, not sending too much multicast packet data to the network, thus greatly maintaining the cleanliness of network data.
[0066] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for discovering cross-network segment devices, characterized in that: include, S1. Add the IP addresses of the network segments that need to be discovered across network segments to the UI; S2. Use a sniffer to sniff devices across specified network segments and select one terminal device from each network segment as the corresponding network segment proxy device. S3. Based on the identified network segment proxy devices, automatically discover cross-network segment devices using a sniffer. S3 specifically includes the following steps. S31. After selecting a network segment proxy device, the Sniffer sends a UDP unicast command to the network segment proxy device to perform device discovery. S32. When the network segment agent device receives the UDP unicast command with the 'device discovery sub-command' sent by the sniffer, it records the sniffer's IP address and returns the command processing result to the sniffer; at the same time, it extracts the 'device discovery sub-command' and forwards the 'device discovery sub-command' via intra-network multicast. S33. Within the same network segment, after receiving the device discovery command sent by the network segment agent device via multicast, the non-network segment agent device also returns a response to the 'device discovery sub-command' via a specific multicast address and port number in a multicast manner. S34. The network segment proxy device listens to specific multicast addresses and ports to receive UDP multicast response packets sent by other devices in the same network segment, and forwards the response packets to the Sniffer in UDP unicast mode. After receiving and parsing the UDP unicast response with 'device discovery response' returned by the network segment proxy device, the S35 and Sniffer display the discovered devices in each network segment on the UI.
2. The cross-network segment device discovery method according to claim 1, characterized in that: Step S1 specifically involves manually adding and configuring the IP addresses and subnet masks of the network segments involved in the cross-segment device discovery operation on the UI, based on the network segment division.
3. The cross-network segment device discovery method according to claim 1, characterized in that: Step S2 specifically involves using a Sniffer to sniff devices across network segments and selecting one terminal device from the sniffed terminal devices of each network segment as the network segment proxy device for the corresponding network segment; or, directly designating one terminal device from each network segment as the network segment proxy device for the corresponding network segment.
4. The cross-network segment device discovery method according to claim 3, characterized in that: Using a sniffer to sniff devices across network segments, and selecting one of the sniffed terminal devices as a network segment proxy device, specifically includes the following: S21. According to the configured cross-network segment IP list, the Sniffer traverses the valid IPs on each network segment, that is, it sends UDP unicast sniffing packets by traversing. Based on whether the devices in the network segment receive and respond to the UDP unicast sniffing packets sent by the Sniffer, it determines whether there are any devices in the specified network segment. S22. If a device exists within the specified network segment, the Sniffer determines the network segment proxy device by specifying the IP address of the proxy device within the network segment according to the proxy selection strategy.
5. The cross-network segment device discovery method according to claim 1, characterized in that: When a terminal device is first selected as a network segment proxy device, it starts a timer. If the terminal device does not receive any more UDP unicast commands within the specified timer timeout period, it is considered that its proxy function has been cancelled and it will no longer forward multicast data sent by other devices in the network segment.
6. A cross-network segment device discovery system, characterized in that: The system uses the method described in any one of claims 1 to 5 to achieve cross-network segment device discovery. The system includes a sniffer and multiple terminal devices, and the sniffer and terminal devices are located in different network segments.
Citation Information
Patent Citations
Cross network segment transmission method of state information in electric power automation system
CN107682165A
DHCP layer 2 relay in vxlan overlay fabric
US20220124037A1