Neighbor discovery method, device and equipment and readable storage medium

By automatically configuring the proxy device table in the protocol stack of network devices, the cumbersome problem of artificially configuring IP addresses in cross-subnet neighbor discovery processing is solved, and automated neighbor discovery processing is realized, reducing costs and delays.

CN119729442APending Publication Date: 2025-03-28BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Application Number
CN202311285431.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, in the neighbor discovery processing across subnets, specific IP addresses need to be configured manually, resulting in inflexible address configuration, cumbersome operation, high management costs and low processing efficiency.

Method used

By automatically configuring and maintaining the proxy device table in the protocol stack of the network device, determining the proxy device table based on the neighbor table of the protocol stack, realizing neighbor discovery responses between different network sides or between different subnets.

Benefits of technology

It realizes automatic configuration and processing of network equipment, reduces human intervention, reduces maintenance costs, improves processing efficiency, and reduces latency and resource consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119729442A_ABST
    Figure CN119729442A_ABST
Patent Text Reader

Abstract

The invention relates to a neighbor discovery method, device and equipment and a readable storage medium, and the method comprises the steps: automatically configuring and maintaining an agented equipment table in network equipment based on a neighbor table of a protocol stack, and when the protocol stack receives a neighbor discovery request for target equipment, carrying out the automatic configuration of the agented equipment table; under the condition that the target equipment is determined to respond to the neighbor discovery request by the network equipment proxy according to the proxy equipment table, the neighbor discovery proxy response is constructed based on the fact that the target equipment is in the communicable state, so that automatic proxy neighbor discovery in the network equipment is realized, the realization requirements of neighbor discovery in various scenes are met, and the user experience is improved. The maintenance cost is reduced, and delay and resource consumption of neighbor discovery are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of communication technology, and in particular to a neighbor discovery method, device, equipment and readable storage medium. Background Art

[0002] Neighbor discovery is a network technology used to find and identify nearby devices or hosts in a wireless network. When a source node needs to communicate with a target node, the source node can send a neighbor discovery request to a neighbor node or default gateway in the local network segment to obtain the MAC address of the target node. Usually, after receiving a neighbor request message, the neighbor node or default gateway determines whether its IP address matches the requested target node IP address. If it matches, it sends a neighbor discovery response as a response. If it does not match, it directly ignores the neighbor discovery request.

[0003] When the source node and the target node are in different subnets or different network sides, it is necessary to manually configure the neighbor agent entry on a specific node in the network to allow the neighbor discovery request for a specific IP address to be forwarded to the specified interface so that the target node can receive the neighbor discovery request and respond. However, the specific IP address processed by the cross-subnet neighbor discovery is manually configured, the address configuration method is inflexible and the operation is cumbersome, the management cost is high, and the processing efficiency is low. Summary of the invention

[0004] In view of this, in order to solve the above technical problems, the present disclosure provides a neighbor discovery method, apparatus, device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a neighbor discovery method is provided, which is applied to a network device deployed with an Internet protocol stack, and the method includes:

[0006] In response to detecting a neighbor discovery request sent by a source device to a protocol stack, determining whether the target device is included in a proxy device table according to target device information carried in the neighbor discovery request; wherein the proxy device table is used to record device information on behalf of the network device to respond to the neighbor discovery request; the proxy device table is determined according to a neighbor table of the protocol stack;

[0007] In a case where the target device is included in the proxied device table, generating a neighbor query request according to information of the target device in the proxied device table and sending the request to the target device;

[0008] When a neighbor query response is obtained from the target device, a neighbor discovery proxy response is generated and sent to the source device.

[0009] In some embodiments, the method further comprises:

[0010] In response to monitoring a neighbor table update event of the protocol stack, updating the proxied device table according to the updated device information in the neighbor table; and / or,

[0011] Periodically obtain device information in the neighbor table of the protocol stack, and update the proxied device table according to the device information.

[0012] In some embodiments, updating the proxy device table includes:

[0013] Determine the second network prefix of each neighbor device according to the neighbor device address information recorded in the neighbor table;

[0014] Determine a neighbor device having the same second network prefix as the first network prefix of the network device as the proxied device;

[0015] The proxied device table is updated according to the information of the proxied device in the neighbor table.

[0016] In some embodiments, the method further comprises:

[0017] In response to obtaining a status notification message from a network-side device, establishing a corresponding neighbor table entry according to the device network information carried in the status notification message;

[0018] According to the neighbor table entry, the neighbor table of the protocol stack is updated.

[0019] In some embodiments, in response to obtaining a neighbor query response from the target device, the method further includes:

[0020] Detecting whether the information of the target device carried in the neighbor query response matches the information of the target device in the neighbor table of the protocol stack;

[0021] If there is no match, the information of the target device in the neighbor table is updated according to the target device information carried in the neighbor query response.

[0022] In some embodiments, the method further comprises:

[0023] When the target device is not included in the proxied device table or the neighbor query response is not obtained, no response is made to the neighbor discovery request.

[0024] In some embodiments, the Internet protocol stack includes an IPV6 protocol stack.

[0025] According to a second aspect of an embodiment of the present disclosure, a neighbor discovery device is provided, which is applied to a network device deployed with an Internet protocol stack, and the device includes:

[0026] A target device determination module, configured to, in response to detecting a neighbor discovery request sent by a source device to a protocol stack, determine whether the target device is included in a proxy device table according to target device information carried in the neighbor discovery request; wherein the proxy device table is used to record device information for responding to the neighbor discovery request on behalf of the network device; and the proxy device table is determined according to a neighbor table of the protocol stack;

[0027] a neighbor query module, which generates a neighbor query request and sends it to the target device according to the information of the target device in the proxied device table when the target device is included in the proxied device table;

[0028] The neighbor discovery proxy response module is used to generate a neighbor discovery proxy response and send it to the source device when a neighbor query response from the target device is obtained.

[0029] In some embodiments, the apparatus may further include:

[0030] The first updating module is configured to update the proxied device table according to the updated device information in the neighbor table in response to monitoring a neighbor table update event of the protocol stack.

[0031] In some embodiments, the apparatus may further include:

[0032] The second updating module is used to periodically obtain the device information in the neighbor table of the protocol stack, and update the proxied device table according to the device information.

[0033] In some embodiments, when the first update module or the second update module is used to update the proxy device table, it includes:

[0034] Determine the second network prefix of each neighbor device according to the neighbor device address information recorded in the neighbor table; determine the neighbor device with the same second network prefix as the first network prefix of the network device as the proxied device; and update the proxied device table according to the information of the proxied device in the neighbor table.

[0035] In some embodiments, the apparatus further comprises:

[0036] In response to obtaining a status notification message from a network-side device, establishing a corresponding neighbor table entry according to the device network information carried in the status notification message;

[0037] According to the neighbor table entry, the neighbor table of the protocol stack is updated.

[0038] In some embodiments, in response to obtaining a neighbor query response from the target device, the apparatus further includes:

[0039] Detecting whether the information of the target device carried in the neighbor query response matches the information of the target device in the neighbor table of the protocol stack;

[0040] If there is no match, the information of the target device in the neighbor table is updated according to the target device information carried in the neighbor query response.

[0041] In some embodiments, the apparatus further comprises: if the target device is not included in the proxied device table or the neighbor query response is not obtained, not responding to the neighbor discovery request.

[0042] In some embodiments, the Internet protocol stack described in any of the above-mentioned device embodiments includes an IPV6 protocol stack.

[0043] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including: a processor and a memory; the memory is used to store a computer program; and the processor is used to call the computer program to implement the above-mentioned neighbor discovery method.

[0044] According to a fourth aspect of an embodiment of the present disclosure, a readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned neighbor discovery method is implemented.

[0045] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0046] The embodiments of the present disclosure automatically configure and maintain a proxied device table in devices in the network according to the neighbor table of the protocol stack, and when the protocol stack receives a neighbor discovery request, implements a neighbor discovery proxy response between different network sides or different subnets based on the proxied device table, thereby realizing automatic configuration and processing of neighbor discovery agents by devices in the network, reducing human intervention, meeting the implementation requirements of neighbor discovery in various scenarios, reducing maintenance costs, and reducing delays and resource consumption in neighbor discovery.

[0047] It should be understood that the above general description and the following detailed description are only exemplary and explanatory and cannot limit the present disclosure. In addition, any embodiment of the present disclosure does not need to achieve all the above effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0049] Figure 1is a flow chart of a neighbor discovery method according to an exemplary embodiment;

[0050] Figure 2 is a flow chart of a method for updating a proxy device table according to a neighbor table according to an exemplary embodiment;

[0051] Figure 3 is a flow chart of a method for updating a neighbor table of a protocol stack according to an exemplary embodiment;

[0052] Figure 4 is a flowchart showing another method of updating a neighbor table of a protocol stack according to an exemplary embodiment;

[0053] Figure 5 It is a schematic diagram of an interaction between a WAN side device and a LAN side device in a neighbor discovery scenario applied to an Internet IPv6 protocol according to an exemplary embodiment;

[0054] Figure 6 is a schematic structural diagram of a neighbor discovery device according to an exemplary embodiment;

[0055] Figure 7 The present invention is a block diagram of a terminal device according to an exemplary embodiment. DETAILED DESCRIPTION

[0056] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0057] The terms used in this disclosure are for the purpose of describing specific embodiments only and are not intended to limit the disclosure. The singular forms of "a", "said" and "the" used in this disclosure and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0058] It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present disclosure, the first classification threshold may also be referred to as the second classification threshold, and similarly, the second classification threshold may also be referred to as the first classification threshold. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0059] like Figure 1 As shown, the present disclosure provides a neighbor discovery method, which can be applied to network devices in the network that need to process neighbor agent related information, including but not limited to routers, firewalls, wireless access points, and gateways, in which a protocol stack for processing communication requests is deployed; it can also be applied to real-time operating systems RTOS and operating systems such as Linux and Windows installed with a protocol stack. The protocol stack can be an Internet communication protocol IPV6 protocol stack.

[0060] Taking the router applied in the network as an example, the method can be applied to the router connected between the client and the network server, or can be applied to the router connecting two different subnets to process neighbor discovery requests and responses from different subnets; it can also be applied to the neighbor discovery processing between routers, setting a specific router and configuring it to use the method of the present disclosure to perform neighbor discovery responses on behalf of other routers on the link. When receiving a neighbor discovery request sent by other routers, the specific router is responsible for responding to the neighbor discovery request. The neighbor discovery method can also be applied to other scenarios where there is a need for neighbor discovery proxy function, and the present disclosure does not limit this.

[0061] Figure 1 is a flowchart of a neighbor discovery method according to an exemplary embodiment. Figure 1 As shown, the method provided by the present disclosure can be applied to a network device deployed with an Internet protocol stack, and the method may include the following steps:

[0062] S101, in response to detecting a neighbor discovery request sent by a source device to a protocol stack, determining whether a proxy device table includes the target device according to target device information carried in the neighbor discovery request; wherein the proxy device table is used to record device information on behalf of the network device to respond to the neighbor discovery request; the proxy device table is determined according to a neighbor table of the protocol stack;

[0063] A protocol stack is a set of protocol layers required to implement network communication. The protocol stack deployed on the network device is responsible for receiving and parsing communication messages from other devices in the network. A neighbor discovery request is used to obtain network information of a target device, such as the MAC address and reachability of the target device. The neighbor discovery request carries information used to uniquely identify the target device, such as the IP address information of the target device.

[0064] When the source device needs to communicate with another device in the network (which may be referred to as the target device), it must first determine the target device's IP address, MAC address, interface identifier and other information. If the target device's information cannot be found in the source device's local cache information, it may send a neighbor discovery request to other devices in the network, such as routers, to obtain the target device's information. In this embodiment, the target device cannot directly respond to the neighbor discovery request sent by the source device, for example, the target device is in an unreachable state and cannot respond to the neighbor discovery request, or the target device and the source device are located in different subnets and cannot directly implement cross-subnet neighbor discovery between each other.

[0065] The neighbor table in the protocol stack deployed on the network device is a data structure maintained and updated by the protocol stack. It is used to store information about neighbor devices directly connected to the network device, such as the IP address, physical address, and other information of the neighbor device, to support communication and network operations between devices.

[0066] For example, the neighbor table of the protocol stack in the router is used to record the device information of each interface connected to the router, and the device information may include information such as IP address, MAC address, reachability status, etc.

[0067] The proxy device table refers to a table or data structure used to record the network information of each device that can be responded to by the network device on behalf of the neighbor discovery request, and is automatically configured and maintained by the network device according to the neighbor table information in the protocol stack; based on the proxy device table, the network device can determine the information of each device that needs to be responded to by the network device on behalf of the neighbor discovery. The proxy device table may include at least the IP address of the proxy device, and may also include at least one of the information such as the physical address, interface name and life cycle of the proxy device; wherein the interface refers to the exit of the network device to send communication messages to the proxy device, which is used to indicate the path for the network device to send data packets from itself to the proxy device, and the life cycle refers to the life cycle or expiration time of the table entry corresponding to the proxy device, indicating the validity period of the table entry corresponding to the proxy device in the proxy device table.

[0068] When the protocol stack of the network device receives a communication message and identifies it as a neighbor discovery request, the target device information carried by the neighbor discovery request can be matched with the device information stored in the proxied device table in the network device to determine whether the target device is one of the proxied devices recorded in the proxied device table, thereby determining whether the network device sends a response message to the neighbor discovery request on behalf of the target device.

[0069] The source device and the target device may be two devices located on different network sides, such as the source device is a WAN side device and the target device is a LAN side device. If the communication between the devices is to be forwarded by a network device such as a router, the network device may respond to the neighbor discovery request on behalf of the target device; or, the source device and the target device may be two devices located on different subnets, and the network device connecting the two devices may act as an agent for the target device to respond to the neighbor discovery request from the source device. It is understandable that the method provided by the present disclosure is not limited to the above-mentioned source device and target device scenarios, but is also applicable to other scenarios where neighbor discovery requests cannot be directly implemented between the source device and the target device. It does not limit the neighbor discovery direction of the network device, and supports two-way proxy between the two devices, which is not limited by the present disclosure.

[0070] S102, when the target device is included in the proxied device table, generating a neighbor query request according to the information of the target device in the proxied device table and sending the request to the target device;

[0071] The neighbor discovery request carries at least identification information for uniquely identifying the target device. When the identification information matches the identification information of the same type of any device in the proxied device table, it is determined that the proxied device includes the target device.

[0072] For example, if the neighbor discovery request includes the IP address information of the target device, after the protocol stack receives the neighbor discovery request, it parses the IP address information carried in the request, matches the IP address information with the IP address information of each device recorded in the proxied device table, and determines the matched device as the target device if the match is successful.

[0073] A neighbor query request is sent by the network device to the target device to detect the status and reachability of the target device. The source IP address and source MAC address of the neighbor query request correspond to the network device, and the destination IP address and destination MAC address correspond to the target device. The neighbor query request can be constructed based on the information of the target device stored in the proxy device table.

[0074] If it is determined that the target device is included in the proxy device table of the network device, it means that the neighbor discovery request for querying the target device information will be responded to by the network device proxy. After receiving the neighbor discovery request, the network device will send a neighbor query request to the target device to determine whether the target device is in a reachable state and whether the network information has changed, thereby determining whether to proxy respond to the neighbor discovery request based on the response result of the target device.

[0075] If the target device is not included in the proxy device table stored locally in the network device, it means that the target device is currently offline or the target device is not responded to neighbor discovery by the network device. Then the network device may not make a proxy response to the neighbor discovery request, that is, not send a response message regarding the neighbor discovery request.

[0076] S103: When a neighbor query response from the target device is obtained, a neighbor discovery proxy response is generated and sent to the source device.

[0077] The neighbor query response is used to respond to the neighbor query request received by the target device, and may include the network information of the target device. The network device receives the neighbor query response, indicating that the target device is currently in an online communicable state, and the network device can construct a neighbor discovery agent response based on the information carried in the neighbor query response.

[0078] The neighbor discovery proxy response is used by the network device to respond to the neighbor discovery request received by the protocol stack on behalf of the target device. The source IP address of the proxy response is the IP address of the target device, the source MAC address is the MAC address of the interface of the network device sending the neighbor discovery proxy response to the source device, and the destination IP address and destination MAC address correspond to the source device. In the process of the proxy target device responding to the neighbor discovery request, the source IP address of the neighbor discovery proxy response sent by the network device is always the IP address of the target device indicated by the neighbor discovery request.

[0079] If the network device does not receive a neighbor query response from the target device, it means that the target device is currently unreachable or offline or in another non-communicative state and cannot communicate with the source device. The network device may not perform a proxy response to the received neighbor discovery request, or may send a proxy response indicating that the target device is in a non-communicative state.

[0080] In the disclosed embodiments, automatic and flexible configuration of the proxied device is achieved by configuring and maintaining the neighbor table of the protocol stack, and when the protocol stack receives a neighbor discovery request for a target device, when it is determined according to the proxied device table that the target device responds to the neighbor discovery request by a network device proxy, a neighbor discovery proxy response is constructed according to the neighbor query response of the target device, thereby adding a neighbor discovery proxy service to the network device, and the network device completes the neighbor discovery response process on behalf of the target device, meeting the implementation requirements of neighbor discovery in various scenarios, reducing maintenance costs, and reducing delays and resource consumption in neighbor discovery.

[0081] In some embodiments, the neighbor discovery method may further include a step of updating the proxy device table, which may be implemented in the following manner:

[0082] In response to monitoring a neighbor table update event of the protocol stack, updating the proxied device table according to the updated device information in the neighbor table; and / or,

[0083] Periodically obtain device information in the neighbor table of the protocol stack, and update the proxied device table according to the device information.

[0084] That is, the neighbor table update of the protocol stack can be monitored by registering the neighbor table update event, and the event can be triggered when the neighbor table changes, so as to automatically execute the update operation of the proxy device table when the neighbor table of the protocol stack changes, so as to improve processing efficiency and reduce power consumption. Neighbor table update events can include: adding neighbor devices, deleting neighbor devices, and changing the state of neighbor devices.

[0085] Alternatively, the device information in the neighbor table of the protocol stack can be periodically detected, such as setting the neighbor table to be obtained every 5 seconds, and the new proxied device can be determined based on the neighbor table obtained within the period, and the new proxied device can be compared with the currently stored proxied device table to update the proxied device table and simplify configuration and management.

[0086] In the embodiments of the present disclosure, by monitoring the neighbor table update events of the protocol stack or periodically detecting the neighbor table information, the proxied device table can be updated in a timely manner to keep the connection status synchronized with the neighboring devices, thereby reducing the need for human intervention and realizing automatic update and maintenance of the proxied device table, so that the proxied device table remains up to date and responds to changes in the network topology in a timely manner.

[0087] In some embodiments, Figure 2 As shown, for the aforementioned method of monitoring the neighbor table update events of the protocol stack or periodically detecting the neighbor table information, the proxy device table can be updated through the following steps:

[0088] S201, determining a second network prefix of each neighbor device according to the neighbor device address information recorded in the neighbor table;

[0089] The network prefix of a device refers to the prefix part of the IP address used by the device in the network, which is used to identify the network segment where the device is located. The network prefix is ​​usually composed of an IP address and a subnet mask. At present, an IP address is a 32-bit or 128-bit number used to uniquely identify a device in the network; the subnet mask is used to divide the network prefix and host identification part of the IP address. The continuous string of 1s in front of the subnet mask represents the network prefix part, and the continuous string of 0s behind it represents the host identification part. The network prefix of the device can be obtained by performing a bitwise AND operation on the subnet mask and the IP address of the device.

[0090] For example, for the IP address 192.168.0.1 and the subnet mask 255.255.255.0, after the bitwise AND operation, the network prefix can be obtained as 192.168.0.0.

[0091] S202, determining a neighbor device having the same second network prefix as the first network prefix of the network device as the proxied device;

[0092] The neighbor devices recorded in the neighbor table of the protocol stack of the network device are devices directly connected to the network device, among which there are neighbor devices whose network prefix is ​​different from the first network prefix of the network device. Such neighbor devices are not responded to neighbor discovery by the network device.

[0093] A bitwise AND operation is performed on the IP address and subnet mask of the network device to obtain the first network prefix of the network device; the second network prefix of each neighbor device recorded in the neighbor table is matched with the first network prefix. When the second network prefix of the neighbor device is the same as the first network prefix, it can be considered that the neighbor device and the network device are in the same network segment, and this type of neighbor device is determined as a proxied device.

[0094] S203: Update the proxied device table according to the information of the proxied device in the neighbor table.

[0095] When at least one proxied device is determined according to step S102, if the information of the proxied device is not stored in the proxied device table, a new table entry of the proxied device can be constructed according to the information of the proxied device recorded in the neighbor table and in accordance with the format requirements in the proxied device table, and the new table entry is added to the proxied device table.

[0096] If the information of the proxied device is already stored in the proxied device table, the information of the proxied device recorded in the neighbor table can be matched with the information recorded in the proxied device table, and the inconsistent information in the proxied device table can be updated according to the neighbor table.

[0097] In the disclosed embodiment, based on the network prefix of the neighbor device recorded in the neighbor table of the protocol stack, the neighbor device with the same network prefix as the network device is determined as the proxied device for which the network device responds to the neighbor discovery request on behalf of the network device, so that the network device maintains the proxied device table with the same network prefix as its own, and responds to the neighbor discovery request on behalf of the network device, thereby reducing the configuration items and management complexity, simplifying the configuration and management process of the neighbor discovery agent, improving the response speed of the network, realizing the automatic maintenance and update of the proxied device table, and providing a more localized, high-performance and security-enhanced automatic proxy service.

[0098] In some embodiments, the neighbor table of the protocol stack described in the aforementioned step S101 may be updated according to the neighbor discovery mechanism and the communication message, and the communication message may include a status notification message, such as Figure 3 As shown, the neighbor discovery method may further include the following steps of determining a neighbor table:

[0099] S301, in response to obtaining a status notification message from a network-side device, establishing a corresponding neighbor table entry according to device network information carried in the status notification message;

[0100] The status notification message is used to report the network information of the network side device to other devices in the network link, including but not limited to device identification, reachability status, network topology information, IP address, interface identifier and link layer address. The network side device can send the status notification message when it just joins the network or when the network status of the device changes, such as address change, link status change, etc.

[0101] When the protocol stack of the network device receives a communication message and identifies it as a status notification message, it can construct a neighbor table entry corresponding to the network side device in the format of the neighbor table based on the source IP address and MAC address of the notification message and other device information carried by the notification message.

[0102] S302: Update the neighbor table of the protocol stack according to the neighbor table entry.

[0103] The IP address in the neighbor table entry can be matched with the device IP address recorded in the neighbor table of the protocol stack. If the match fails, the neighbor table entry is added to the neighbor table; if the match is successful, the neighbor table entry can be used to replace the neighbor table entry corresponding to the matched IP address, or the neighbor table entry can be compared with the information of the matched neighbor table entry to update the matched neighbor table entry.

[0104] In the disclosed embodiment, the neighbor table of the protocol stack is updated according to the received status notification message to keep the real-time of the neighbor information, so as to adjust its own network configuration and routing strategy and improve the reliability of the network.

[0105] In some embodiments, when a neighbor query response from the target device is obtained in step S103, the neighbor discovery method may further include updating the neighbor table information based on the content carried by the neighbor query response, such as Figure 4 As shown, the following implementations may be included:

[0106] S401, detecting whether the information of the target device carried in the neighbor query response matches the information of the target device in the neighbor table of the protocol stack;

[0107] S402: If there is no match, updating the information of the target device in the neighbor table according to the target device information carried in the neighbor query response.

[0108] The device information carried by the neighbor query response from the target device indicates the latest network status of the target device. Updating the neighbor table according to the received neighbor query response can maintain the real-time performance of the neighbor table.

[0109] When the target device is not included in the neighbor table of the protocol stack, a neighbor table entry can be established based on the information of the target device carried in the neighbor query response, and the neighbor table entry can be added to the neighbor table; if the information of the target device carried in the neighbor query response is inconsistent with the information of the target device recorded in the neighbor table, the information recorded in the neighbor table is updated based on the information carried in the neighbor query response.

[0110] In the disclosed embodiment, the neighbor table information of the protocol stack is updated according to the received neighbor query response, thereby ensuring the accuracy of the target device information recorded in the neighbor table in the protocol stack, which is beneficial to maintaining the stability of the network topology and improving the reliability and efficiency of data transmission.

[0111] In order to enable those skilled in the art to more clearly understand the neighbor discovery method provided by the present disclosure, the neighbor discovery scenario between a WAN side device and a LAN side device under the IPV6 protocol is taken as an example to exemplify the present disclosure scheme.

[0112] In this embodiment, the network device may be a router or a wireless access point AP that connects the WAN side device and the LAN side device, and the IPV6 protocol stack is deployed in the network device.

[0113] This embodiment involves the interaction between the WAN side device, the LAN side device and the network device. Take the WAN side device as the source device and the target LAN side device as the target device as an example. Figure 5 The interaction process between the WAN side device, the LAN side device and the network device is shown. The neighbor discovery method may include the following steps:

[0114] S501, the WAN side device sends a neighbor request message to the protocol stack of the network device, the neighbor request message is used to obtain the device information of the target LAN side device, the destination IP address encapsulated in the neighbor request message is the IPV6 address of the target LAN side device, and the destination MAC address is the MAC address of the network device.

[0115] The neighbor discovery request on the WAN side generally refers to the neighbor solicitation (NS) message in the neighbor discovery protocol (NDP) in the IPv6 network. The neighbor solicitation message is used to query and obtain information such as the MAC address of the target LAN device.

[0116] It is important to note that the correct target IPv6 address must be specified when sending a neighbor solicitation message. Otherwise, the neighbor solicitation message will not be processed correctly, which may cause communication interruption or other communication failures.

[0117] S502, after detecting that the protocol stack has received a neighbor request message, the network device matches the destination IP address of the neighbor request message with the IPV6 addresses of each device in the locally stored proxied device table to determine whether the target LAN side device exists in the proxied device table; the proxied device table is used to record the LAN device information in the LAN side device that is responded to the neighbor discovery request by the network device.

[0118] That is, after receiving the neighbor request message, the protocol stack of the network device does not use the standard IPV6 protocol stack to set the neighbor request message processing method, that is, the protocol stack determines whether the destination IP address of the neighbor request message matches the IP address of the network device. If so, the device requested by the neighbor request message is the network device, and the network device sends a response message based on its own device information. The source IP address and source MAC address of the response message correspond to the network device. If they do not match, they are directly ignored. Instead, according to the method provided in the present invention, it is determined whether the target device requested by the neighbor request message is a device that is responded to neighbor discovery by the network device agent, so as to realize the neighbor discovery agent response.

[0119] S503, in response to the destination IP address of the neighbor request message successfully matching a device in the proxied device table, constructing a query request to be sent to the target LAN side device according to the information of the successfully matched proxied device, and sending the query request to the target LAN side device.

[0120] S504, when the target LAN side device is online, after receiving the query request, the target LAN device generates a query response for responding to the query request and sends it to the network device;

[0121] Based on the query response being sent to the network device, the destination IP address and the destination MAC address of the query response correspond to the network device.

[0122] S505, after receiving the query response, the network device constructs a proxy response message according to the information of the target LAN side device in the query response, and the proxy response message is used by the network device to respond to the neighbor request message on behalf of the target LAN side device.

[0123] The source IP address of the constructed proxy reply message is the IPV6 address of the target LAN side device, and the source MAC address is the WAN interface address on the network device connected to the WAN side device.

[0124] The proxy response message can be obtained by modifying the address and repackaging the received query response, or by reconstructing a new proxy response message according to the information carried in the query response.

[0125] If the target LAN side device is offline or in a communication failure state, the network device will not receive a query response from the target LAN side device, and the network device will not respond to the received neighbor request message.

[0126] In this embodiment, a neighbor proxy service function can be added to the network device. The neighbor proxy service function is used to interact with the protocol stack to implement the above-mentioned neighbor discovery method, so that after the protocol stack of the network device receives the neighbor discovery request, it no longer processes it in the manner specified by the standard IPV6 protocol stack, but instead hands the neighbor discovery request to the neighbor proxy service function for automatic processing in the manner described in the above-mentioned steps S502-S505; alternatively, the above-mentioned neighbor discovery method can be executed by the protocol stack of the network device, and the neighbor proxy service function can be integrated into the protocol stack by improving the original standard IPV6 protocol stack deployed in the network device, so that after the protocol stack receives the neighbor discovery request, the protocol stack automatically processes it in the manner described in steps S502-S505.

[0127] The above embodiment describes a neighbor discovery proxy from a WAN side device to a LAN side device. Based on a similar principle, a neighbor discovery proxy from a LAN side device to a WAN side device can also be implemented. The present disclosure is not limited to the direction of the neighbor discovery proxy.

[0128] See also Figure 5 As shown, in the process of realizing neighbor discovery through device interaction, steps such as updating the neighbor table in the protocol stack of the network device and updating the proxy device table may also be included. The operations described in these steps may be performed simultaneously with the steps of the neighbor discovery method. The method may include:

[0129] S506: When the LAN side device is a device newly added to the network or the network information is changed, the LAN side device sends a status notification message to the protocol stack of the network device.

[0130] S507, after receiving the status notification message, the IPv6 protocol stack deployed on the network device updates the neighbor table maintained in the stack according to the status notification message;

[0131] S508 , in response to monitoring a neighbor table update event in the protocol stack, the network device determines a proxied device and updates the proxied device table based on the updated neighbor table and the principle that the device network prefix in the neighbor table matches the network prefix of the network device.

[0132] In the embodiments of the present disclosure, by binding the proxied device table with the neighbor table of the protocol stack and relying on update events of the neighbor table items to trigger automatic maintenance operations of the proxied device table, power consumption can be reduced and efficiency can be improved. Devices in the neighbor table with the same network prefix as the network device are used as devices discovered by the network device proxy neighbors, thereby realizing automatic configuration and updating of the proxied device table. Without adding additional neighbor discovery proxy devices, neighbor discovery processing in different scenarios is realized based on the proxied device table by utilizing intermediate devices connected to different network sides or different subnets. The automatic processing of the protocol stack of the intermediate device reduces human intervention, realizes automatic and flexible configuration and implementation of neighbor discovery, and reduces maintenance costs.

[0133] The steps described in the above embodiments do not necessarily require a specific execution order or execution timing. In some embodiments, the steps may be executed in a different order or timing and still achieve the desired effect.

[0134] Corresponding to the above-mentioned embodiment of the neighbor discovery method, Figure 6 is a schematic diagram of a neighbor discovery device according to an exemplary embodiment, the device is applied to a network device deployed with an Internet protocol stack, such as Figure 6 As shown, the apparatus includes a target device determination module 601, a neighbor query module 602, and a neighbor discovery agent response module 603;

[0135] The target device determination module 601 is used to determine whether the target device is included in the proxy device table according to the target device information carried in the neighbor discovery request in response to detecting the neighbor discovery request sent by the source device to the protocol stack; wherein the proxy device table is used to record the device information of the neighbor discovery request responded by the network device; the proxy device table is determined according to the neighbor table of the protocol stack;

[0136] A neighbor query module 602, when the target device is included in the proxied device table, generates a neighbor query request according to the information of the target device in the proxied device table and sends it to the target device;

[0137] The neighbor discovery proxy response module 603 is used to generate a neighbor discovery proxy response and send it to the source device when a neighbor query response from the target device is obtained.

[0138] In some embodiments, the apparatus may further include:

[0139] The first updating module is configured to update the proxied device table according to the updated device information in the neighbor table in response to monitoring a neighbor table update event of the protocol stack.

[0140] In some embodiments, the apparatus may further include:

[0141] The second updating module is used to periodically obtain the device information in the neighbor table of the protocol stack, and update the proxied device table according to the device information.

[0142] In some embodiments, when the first update module or the second update module is used to update the proxy device table, it includes:

[0143] Determine the second network prefix of each neighbor device according to the neighbor device address information recorded in the neighbor table; determine the neighbor device with the same second network prefix as the first network prefix of the network device as the proxied device; and update the proxied device table according to the information of the proxied device in the neighbor table.

[0144] In some embodiments, the apparatus further comprises:

[0145] In response to obtaining a status notification message from a network-side device, establishing a corresponding neighbor table entry according to the device network information carried in the status notification message;

[0146] According to the neighbor table entry, the neighbor table of the protocol stack is updated.

[0147] In some embodiments, in response to obtaining a neighbor query response from the target device, the apparatus further includes:

[0148] Detecting whether the information of the target device carried in the neighbor query response matches the information of the target device in the neighbor table of the protocol stack;

[0149] If there is no match, the information of the target device in the neighbor table is updated according to the target device information carried in the neighbor query response.

[0150] In some embodiments, the apparatus further comprises: if the target device is not included in the proxied device table or the neighbor query response is not obtained, not responding to the neighbor discovery request.

[0151] In some embodiments, the Internet protocol stack described in any of the above-mentioned device embodiments includes an IPV6 protocol stack.

[0152] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0153] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the disclosed solution. A person of ordinary skill in the art may understand and implement it without creative work.

[0154] The embodiment of the present disclosure also provides a terminal device. The terminal device includes: a memory and a processor. The memory stores processor executable instructions, and the processor is configured to execute the executable instructions in the memory to implement the above-mentioned neighbor discovery steps. In the embodiment of the present disclosure, the terminal device can be selected as a network device such as a router, a firewall, a wireless access point, etc. in the network that needs to process neighbor discovery requests from different subnets or different network sides.

[0155] Figure 7 is a block diagram of a terminal device provided according to an exemplary embodiment. Figure 7 As shown, the terminal device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input / output (I / O) interface 712, a sensor component 714, a communication component 716, and an image acquisition component.

[0156] The processing component 702 generally controls the overall operation of the terminal device 700, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions. In addition, the processing component 702 may include one or more units to facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia unit to facilitate interaction between the multimedia component 708 and the processing component 702.

[0157] The memory 704 is configured to store various types of data to support operations on the terminal device 700. Examples of such data include instructions for any application or method operating on the terminal device 700, contact data, phone book data, messages, pictures, videos, etc. The memory 704 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0158] The power supply component 706 provides power to various components of the terminal device 700. The power supply component 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the terminal device 700.

[0159] The multimedia component 708 includes a screen that provides an output interface between the terminal device 700 and the target object. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the target object. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0160] The audio component 710 is configured to output and / or input audio signals. For example, the audio component 710 includes a microphone (MIC), and when the terminal device 700 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 704 or sent via the communication component 716. In some embodiments, the audio component 710 also includes a speaker for outputting audio signals.

[0161] The I / O interface 712 provides an interface between the processing component 702 and a peripheral interface unit, such as a keyboard, a click wheel, a button, etc.

[0162] The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the terminal device 700. For example, the sensor assembly 714 can detect the open / closed state of the terminal device 700, the relative positioning of components, such as the display screen and keypad of the terminal device 700, and the sensor assembly 714 can also detect the position change of the terminal device 700 or a component, the presence or absence of contact between the target object and the terminal device 700, the orientation or acceleration / deceleration of the terminal device 700, and the temperature change of the terminal device 700. For another example, the sensor assembly 714 also includes a light sensor, which is arranged below the OLED display screen.

[0163] The communication component 716 is configured to facilitate the communication between the terminal device 700 and other devices in a wired or wireless manner. The terminal device 700 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 also includes a near field communication (NFC) unit to facilitate short-range communication. For example, the NFC unit can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0164] In an exemplary embodiment, the terminal device 700 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components.

[0165] In an exemplary embodiment, the present disclosure also provides a readable storage medium, which stores executable instructions. The executable instructions can be executed by a processor of a terminal device to implement the steps of the neighbor discovery method provided above. The readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0166] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the above claims.

[0167] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A neighbor discovery method, characterized in that: Applied to a network device deployed with an Internet protocol stack, the method comprises: In response to detecting a neighbor discovery request sent by a source device to a protocol stack, determining whether the target device is included in a proxy device table according to target device information carried in the neighbor discovery request; wherein the proxy device table is used to record device information on behalf of the network device to respond to the neighbor discovery request; the proxy device table is determined according to a neighbor table of the protocol stack; In a case where the target device is included in the proxied device table, generating a neighbor query request according to information of the target device in the proxied device table and sending the request to the target device; When a neighbor query response is obtained from the target device, a neighbor discovery proxy response is generated and sent to the source device.

2. The method according to claim 1, characterized in that: The method further comprises: In response to monitoring a neighbor table update event of the protocol stack, updating the proxied device table according to the updated device information in the neighbor table; and / or, Periodically obtain device information in the neighbor table of the protocol stack, and update the proxied device table according to the device information.

3. The method according to claim 2, characterized in that The updating of the proxy device table includes: Determine the second network prefix of each neighbor device according to the neighbor device address information recorded in the neighbor table; Determine a neighbor device having the same second network prefix as the first network prefix of the network device as the proxied device; The proxied device table is updated according to the information of the proxied device in the neighbor table.

4. The method according to claim 1, characterized in that: The method further comprises: In response to obtaining a status notification message from a network-side device, establishing a corresponding neighbor table entry according to the device network information carried in the status notification message; According to the neighbor table entry, the neighbor table of the protocol stack is updated.

5. The method according to claim 1, characterized in that In response to obtaining a neighbor query response from the target device, the method further includes: Detecting whether the information of the target device carried in the neighbor query response matches the information of the target device in the neighbor table of the protocol stack; If there is no match, the information of the target device in the neighbor table is updated according to the target device information carried in the neighbor query response.

6. The method according to claim 1, characterized in that The method further comprises: When the target device is not included in the proxied device table or the neighbor query response is not obtained, no response is made to the neighbor discovery request.

7. The method according to any one of claims 1 to 6, characterized in that: The Internet protocol stack includes an IPV6 protocol stack.

8. A neighbor discovery device, characterized in that: Applied to a network device deployed with an Internet protocol stack, the device comprises: A target device determination module, configured to, in response to detecting a neighbor discovery request sent by a source device to a protocol stack, determine whether the target device is included in a proxy device table according to target device information carried in the neighbor discovery request; wherein the proxy device table is used to record device information for responding to the neighbor discovery request on behalf of the network device; and the proxy device table is determined according to a neighbor table of the protocol stack; a neighbor query module, which generates a neighbor query request and sends it to the target device according to the information of the target device in the proxied device table when the target device is included in the proxied device table; The neighbor discovery proxy response module is used to generate a neighbor discovery proxy response and send it to the source device when a neighbor query response from the target device is obtained.

9. An electronic device, characterized in that: include: Processor, memory; The memory is used to store computer programs; The processor is used to call the computer program to implement the neighbor discovery method according to any one of claims 1 to 7.

10. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the neighbor discovery method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and system for searching node

    CN102014456A

  • Network mobility for multi-level networks

    CN102047704A

  • Method and system for realizing neighbor discovery proxy based on duplicate address detection (DAD)

    CN102546308A

  • Method and device for determining neighbor user equipment in WLAN

    CN103546926A

  • Method, system, and apparatus for proxying intra-subnet traffic across multiple interfaces within networks

    CN107426343A

Cited By

  • Network topology structure generation method, electronic equipment and computer readable storage medium

    CN120050182A