Detection networking method of network equipment and network equipment

Through message interaction between master and slave routers, the network can be quickly identified and re-detected, solving the problem of low network device recovery efficiency when the network topology changes, and achieving rapid network recovery.

CN120750831AActive Publication Date: 2025-10-03HONOR DEVICE CO LTD
View PDF 14 Cites 0 Cited by

Patent Information

Application Number
CN202411133399.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2025-10-03
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

When the network topology changes, existing technologies are unable to quickly identify and automatically re-detect the network, resulting in network equipment being unable to resume normal operation in a timely manner.

Method used

Through message interaction between the master router and slave routers, using topology discovery, topology notification, topology query request, and topology query reply messages, business scenarios can be quickly identified and detection networking can be initiated to ensure the normal operation of network devices.

Benefits of technology

This ensures that when the master router changes, the slave router can quickly identify the networking changes and automatically re-detect the networking, improving network recovery efficiency and avoiding delays caused by waiting for route aging time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120750831A_ABST
    Figure CN120750831A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a detection networking method of network equipment and the network equipment, the method is executed by first network equipment, and the method comprises the following steps: under the condition that a first message from second network equipment is received, sending a second message to the second network equipment, the first message is a message sent by the second network equipment when the second network equipment meets a first condition, and the first condition comprises that the second network equipment receives a third message from the first network equipment or third network equipment, or the second network equipment detects that the equipment is restarted or a networking switch is turned on; receiving a fourth message replied by the second network equipment for the second message, wherein the fourth message carries equipment node information and operation role information of the second network equipment; and according to the fourth message, determining a service scene in which the first network device is currently located, and initiating detection networking to the second network device according to the service scene. Therefore, under the condition that the master router changes, the slave router can perform detection networking quickly and timely.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a detection and networking method for network equipment and a network equipment. Background Art

[0002] With the improvement of living standards, people's demands in various aspects are getting higher and higher. For example, they live in large houses, rent large office buildings, etc. In order to make every corner of these areas covered by wireless networks, people will choose to use multiple network devices (such as routers) to form a network.

[0003] When multiple routers are used to form a network, changes to the original network topology are inevitable, such as adding or replacing a master router or changing master router parameters. Therefore, when the network topology changes, how to quickly identify the network change scenario and automatically re-detect the network is an urgent problem that needs to be solved. Summary of the Invention

[0004] The present application provides a detection and networking method for network devices and a network device, which can enable the slave routers to quickly and timely perform detection and networking through message interaction with the slave routers when changes occur in the master router, thereby ensuring the normal operation of the network.

[0005] In a first aspect, the present application provides a detection networking method for a network device, which is executed by a first network device, including: upon receiving a first message from a second network device, sending a second message to the second network device, wherein the first message is a message sent by the second network device when a first condition is met, the first condition including: the second network device receives a third message from the first network device or a third network device, or the second network device detects that the device is restarted or the networking switch is turned on; receiving a fourth message from the second network device in reply to the second message, the fourth message carrying device node information and operating role information of the second network device; determining the current business scenario of the first network device based on the fourth message, and initiating detection networking to the second network device based on the business scenario.

[0006] Among them, the first network device and the second network device are originally in the same networking. If the second network device changes, such as being replaced or restarted, the first network device needs to re-detect the networking of the second network device to ensure the normal operation of the network. In this application, if the second network device is replaced, the third network device adjacent to the second network device will send a third message to the second network device. If the second network device is a newly cascaded device on the first network device, the first network device will send a third message to the second network device. If the second network device is restarted or the networking switch is turned on, the second network device will detect these change events. In these scenarios, the second network device can send the first message to the first network device in a timely manner, and then the first network device triggers the sending of the second message to the second network device, and receives the fourth message replied by the second network device. Therefore, the first network device can parse the fourth message, determine the current business scenario, and then quickly and timely initiate a network detection to the second network device to ensure the normal operation of the network.

[0007] In some implementations, the second network device may be a master router, and the first network device may be a slave router connected downstream to the master router.

[0008] In some implementations, the first message may be a topology notification message (topo notify), the second message may be a topology query request message (topo query request), the fourth message may be a topology query reply message (topo query response), and the third message may be a topology discovery message (topo discovery).

[0009] In combination with the first aspect, in some implementation methods of the first aspect, the above-mentioned determining the current business scenario of the first network device based on the fourth message includes: parsing the fourth message to obtain the device node information and operation role information of the second network device; determining the current business scenario of the first network device based on the device node information and operation role information of the second network device, and the operation role information of the first network device.

[0010] Among them, because the fourth message carries the device node information and operation role information of the second network device, the first network device can parse the fourth message after receiving the fourth message sent by the second network device to obtain the device node information and operation role information of the second network device. For example, the device node information includes the MAC address of the second network device. Then, the first network device can determine the above-mentioned business scenario (or business scenario category) based on the parsed device node information and operation role information of the second network device, as well as its own operation role information. In this way, a data basis can be provided for the first network device to initiate detection networking, so that the first network device can quickly initiate detection networking according to the business scenario.

[0011] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned determining the current business scenario of the first network device based on the device node information and operating role information of the second network device, as well as the operating role information of the first network device, includes: when it is determined that the device node information of the second network device does not exist in the first network device, creating a corresponding device node based on the device node information of the second network device, and initializing the operating role of the device node to an initial value; if the operating role of the device node is the initial value, and the parsed operating role information of the second network device is a master router role, determining the current business scenario of the first network device based on the operating role information of the first network device.

[0012] After the first network device parses the device node information of the second network device, the device node information may or may not exist in the first network device. If the device node information of the second network device exists in the first network device, it means that the second network device is not a new device, and the corresponding operating role can be updated and saved based on the above-parsed operating role information. If the device node information of the second network device does not exist in the first network device, it means that the second network device is a new device, and a device node can be created based on the parsed device node information, and the operating role of the device node can be initialized to the initial value. Subsequently, the first network device can determine the current business scenario based on the operating role of the device node.

[0013] If the second network device mentioned above has changed, it should be a new device node relative to the first network device. In this case, the operating role corresponding to the device node is the initial value (i.e., the operating role has not yet been updated to the parsed operating role information). However, the operating role information parsed from the above message is the master router role, indicating that the first network device is likely to re-probe the network. The first network device can then continue to determine the current business scenario based on its own operating role information. As a result, the first network device can subsequently quickly initiate a network probe based on the business scenario.

[0014] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned determining the current business scenario of the first network device based on the operating role information of the first network device includes: if the operating role information of the first network device is a slave router role, determining that the current business scenario of the first network device is the first scenario or the second scenario, the first scenario represents a scenario in which the second network device is a newly replaced master router, and the second scenario represents a scenario in which the second network device is restarted; if the operating role information of the first network device is a master router role, determining that the current business scenario of the first network device is the third scenario, the third scenario represents a scenario in which the first network device is the old master router and the second network device is a new master router cascaded on the first network device; if the operating role information of the first network device is the initial value and a detection timeout has occurred, determining that the current business scenario of the first network device is the fourth scenario, the fourth scenario represents a scenario in which the networking switch of the second network device is turned on after the first network device detects the networking timeout.

[0015] Among them, in the first and second scenarios, the master router is replaced or restarted, and the first network device has not changed and still plays the role of a slave router. In the third scenario, a new master router (i.e., the second network device) is cascaded to the old master router (i.e., the first network device). Although the first network device has been downgraded to a slave router, its operating role information has not changed and it still plays the previous master router role. In the fourth scenario, the first network device has previously experienced a detection timeout, that is, the network was not successfully established, and it has not updated its own operating role information, which remains at the initial value.

[0016] In combination with the first aspect, in some implementation methods of the first aspect, the above-mentioned initiation of detection networking to the second network device according to the business scenario includes: when the business scenario is the first scenario, the second scenario or the fourth scenario, the first network device initiates detection networking on all ports, and completes the networking after receiving the detection response from the second network device; when the business scenario is the third scenario, the first network device initiates detection networking at the wide area network interface WAN port, and completes the networking after receiving the detection response from the second network device.

[0017] After the business scenario is identified as above, the first network device can initiate detection networking according to the business scenario. If it is the first scenario, the second scenario or the fourth scenario, the first network device can initiate detection requests on all ports or plug-in ports, because the ports of the first network device may be connected to computer devices in addition to the upper-level network devices, but the first network device is not sure which port is connected to the network device. Therefore, it can initiate detection requests from all ports or plug-in ports, and after receiving the detection response from the port connected to the network device, it will act as a slave router to complete the detection networking. If it is the third scenario, the first network device can only initiate detection requests on the WAN port, because this scenario is to cascade a master router on the old master router, and the new master router can only be upstream of the old master router. Therefore, in this scenario, the first network device (i.e., the old master router) can only initiate detection requests on the upstream WAN port to improve detection efficiency. After the first network device receives the detection response, it will downgrade itself to the slave router role to complete the detection networking.

[0018] In combination with the first aspect, in some implementations of the first aspect, when the first condition is that the second network device receives a third message from the first network device or the third network device, the third message is a message sent by the first network device or the third network device when detecting a port plugging and unplugging event.

[0019] From the above description, it can be seen that if the second network device is replaced, the third network device adjacent to the second network device will send a third message to the second network device. If the second network device is a newly cascaded device on the first network device, the first network device will send a third message to the second network device, that is, when the second network device receives the third message, it will trigger the sending of the first message to the first network device. The third message sent by the first network device or the third network device is usually sent when a port plug-in and unplug event is detected, because when the second network device is replaced, the port of the third network device will experience a plug-in and unplug event, and when the first network device is newly cascaded, the port of the first network device will also experience a plug-in and unplug event. Therefore, the second network device can send the first message to the first network device in a timely manner when a state change occurs, so as to trigger the first network device to quickly and promptly perform network detection.

[0020] In a second aspect, the present application provides a detection and networking method for a network device, which is executed by a second network device and includes: sending a first message to the first network device when a first condition is met, the first condition including: the second network device receives a third message from the first network device or the third network device, or the second network device detects that the device is restarted or the networking switch is turned on; receiving a second message from the first network device, and replying a fourth message to the first network device for the second message, the fourth message carrying the device node information and operation role information of the second network device; receiving a detection and networking request from the first network device, and replying a detection response to the first network device, the detection and networking request being a request initiated according to the business scenario after the first network device determines the current business scenario of the first network device according to the fourth message.

[0021] Among them, the first network device and the second network device are originally in the same networking. If the second network device changes, such as being replaced or restarted, the first network device needs to re-detect the networking of the second network device to ensure the normal operation of the network. In this application, if the second network device is replaced, the third network device adjacent to the second network device will send a third message to the second network device. If the second network device is a newly cascaded device on the first network device, the first network device will send a third message to the second network device. If the second network device is restarted or the networking switch is turned on, the second network device will detect these change events. In these scenarios, the second network device can send the first message to the first network device in a timely manner, and then the first network device triggers the sending of the second message to the second network device, and receives the fourth message replied by the second network device. Therefore, the first network device can parse the fourth message, determine the current business scenario, and then quickly and timely initiate a network detection to the second network device to ensure the normal operation of the network.

[0022] In conjunction with the first aspect, in some implementations of the first aspect, when the second network device receives a third message from the first network device or the third network device, the method further includes: parsing the third message to determine whether the first network device or the third network device is a new device;

[0023] Correspondingly, sending the first message to the first network device includes: when the first network device or the third network device is a new device, sending the first message to the first network device.

[0024] Typically, when the second network device receives the third message, since the second network device has changed, it will not store information about the first network device or the third network device, that is, the first network device or the third network device should be a new device relative to the second network device. Accordingly, when it is determined through analysis that the first network device or the third network device is a new device, the first message can be sent to the first network device to trigger the first network device to quickly and timely perform detection and networking.

[0025] In a third aspect, the present application provides an apparatus, included in a network device, that has the functionality to implement the network device behavior described in the first aspect and its possible implementations, or the functionality to implement the network device behavior described in the second aspect and its possible implementations. The functionality can be implemented in hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the aforementioned functionality, such as a receiving module or unit, a processing module or unit, etc.

[0026] In a fourth aspect, the present application provides a first network device, including:

[0027] a message processing module, configured to receive a first message from a second network device, wherein the first message is a message sent by the second network device when a first condition is met, the first condition including: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or a networking switch is turned on;

[0028] a topology management module, configured to trigger the message processing module to send a second message to the second network device;

[0029] The message processing module is further configured to receive a fourth message from the second network device in reply to the second message, the fourth message carrying device node information and operation role information of the second network device;

[0030] Network management module, used to provide different detection interfaces for different business scenarios;

[0031] The scenario identification module is used to determine the current business scenario of the first network device according to the fourth message, and according to the business scenario, call the networking management module to initiate a detection network to the second network device according to different detection interfaces.

[0032] In a fifth aspect, the present application provides a second network device, including:

[0033] a message processing module, configured to send a first message to the first network device when a first condition is met, the first condition including: the second network device receiving a third message from the first network device or the third network device, or the second network device detecting that the device is restarted or the networking switch is turned on;

[0034] The message processing module is further configured to receive a second message from the first network device;

[0035] a topology management module, configured to trigger the message processing module to reply a fourth message to the first network device in response to the second message, where the fourth message carries device node information and operation role information of the second network device;

[0036] The networking management module is used to receive a detection networking request from the first network device and reply a detection response to the first network device. The detection networking request is a request initiated according to the business scenario after the first network device determines the current business scenario of the first network device based on the fourth message.

[0037] In a sixth aspect, the present application provides a network device, the network device comprising: a processor, and a transceiver;

[0038] The transceiver is used to send messages to other network devices, or receive messages sent by other network devices; the processor is used to call computer instructions to enable the network device to execute any one of the methods in the technical solution of the first aspect, or execute any one of the methods in the technical solution of the second aspect.

[0039] In the seventh aspect, the present application provides a chip system, which is applied to a network device. The chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the network device to execute the method in the first aspect and any possible implementation thereof, or execute the method in the second aspect and any possible implementation thereof.

[0040] Optionally, the chip system also includes a memory, and the memory is connected to the processor via circuits or wires.

[0041] Further optionally, the chip system also includes a communication interface.

[0042] In an eighth aspect, the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on a network device, the network device executes any one of the methods in the technical solution of the first aspect, or executes any one of the methods in the technical solution of the second aspect.

[0043] In the ninth aspect, the present application provides a computer program product, which includes: computer program code, which, when the computer program code runs on a network device, enables the network device to execute any one of the methods in the technical solution of the first aspect, or execute any one of the methods in the technical solution of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 This is a schematic diagram of a topology structure obtained by networking multiple routers according to an embodiment of the present application;

[0045] Figure 2 This is a schematic diagram of a scenario in which a network topology structure changes, provided in an embodiment of the present application;

[0046] Figure 3 This is another schematic diagram of a scenario in which a network topology structure changes, provided by an embodiment of the present application;

[0047] Figure 4 This is another schematic diagram of a scenario in which a network topology structure changes, provided in an embodiment of the present application;

[0048] Figure 5 This is another schematic diagram of a scenario in which a network topology structure changes, provided in an embodiment of the present application;

[0049] Figure 6 This is a schematic diagram of a system architecture used in a method for detecting and networking a network device according to an embodiment of the present application;

[0050] Figure 7 This is a diagram of message interaction in a detection networking method for a network device provided in an embodiment of the present application;

[0051] Figure 8 This is a diagram of message interaction in another example of a detection networking method for a network device provided in an embodiment of the present application;

[0052] Figure 9 This is a diagram of message interaction in another example of a detection networking method for a network device provided in an embodiment of the present application;

[0053] Figure 10 This is a diagram of message interaction in another example of a detection networking method for a network device provided in an embodiment of the present application;

[0054] Figure 11 This is a flow chart of a method for detecting and networking a network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0056] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.

[0057] With the improvement of living standards, people's demands in various aspects are getting higher and higher. For example, they live in large-sized houses, rent large office buildings, etc. In order to make every corner of these areas covered by wireless networks, people will choose to use multiple network devices for networking.

[0058] Among them, the network device here can be a router, or other devices with functions such as network connection and forwarding network data packets. The embodiment of the present application is explained by taking a router as an example. The traditional networking method of multiple routers may include but is not limited to wireless bridging, wired connection and hybrid networking. Wireless bridging is a common networking method of multiple routers. In this networking method, one router serves as the master router and the other routers serve as slave routers. The master router is connected to the Internet via a wired connection, and the slave routers are connected to the master router via a wireless connection. Wired connection is a simple networking method of multiple routers. In this networking method, all routers are connected to the Internet via a wired connection. Hybrid networking is a complex networking method of multiple routers. In this networking method, the above networking methods can be combined and the appropriate networking method can be selected according to actual needs. It can be understood that the detection networking method of the network device proposed in the embodiment of the present application can be adapted to any of the above networking methods.

[0059] When multiple network devices (such as routers) are used to form a network, people will inevitably make some changes to the original network topology, such as adding or replacing the main router, changing the main router parameters, etc. For example, the topology structure obtained by networking multiple routers can be as follows: Figure 1 As shown, for Figure 1 In Figure (a), after the master router is connected to the gateway, it is connected to multiple slave routers in the downstream. Figure 1In Figure (b), after the master router connects to the gateway, it is then connected downstream to multiple slave routers. Of course, there are many other networking topologies, which are not listed here. When multiple routers are networked, each router has a unique Internet Protocol address (IP address) and subnet mask. Different routers use different IP addresses. The gateway address is usually set to the IP address of the master router. The subnet mask on all routers is set to the same to ensure correct network identification. Each router also uses the same service set identifier (SSID) for communication.

[0060] In these scenarios, if the main router is added or replaced, or the main router parameters are changed, that is, the network topology structure changes, how to quickly identify the network change scenario and automatically re-detect the network is an urgent problem that needs to be solved.

[0061] Below we will first introduce several common scenarios where network topology changes occur. The first scenario is, for example Figure 2 As shown in the figure, the original topology is that the master router R1 is connected to the gateway, and the downstream routers are connected to slave routers R2, R3, and so on. Now the master router R1 is replaced with R4. During the replacement process, the slave router R2 can detect the port plug-in and unplug events (down / up events), which can trigger re-networking. However, since the slave router R3 is connected to the slave router R2, there is no change in the port status between R2 and R3. Therefore, the slave router R3 cannot perceive that the master router R1 has been replaced by R4. Accordingly, it cannot initiate detection, that is, it cannot re-network with the new master router R4. In related technologies, to solve this problem, during the process of replacing the master router R1 with R4, since it is impossible to send a message to the slave router R3 in a short period of time, the slave router R3 will wait for a routing aging time (for example, the routing aging time is 3 minutes), and then trigger the re-networking with the new master router R4. However, during the routing aging time, the master router R4 may have been replaced and started working (for example, the replacement work was completed in 1 minute), while the slave router R3 is still waiting. Obviously, this method is relatively inefficient and cannot be quickly identified to trigger re-detection of networking. Among them, the above-mentioned routing aging time means that after a router is disconnected from an adjacent router, if the connection is not re-established within a certain time interval, the router will remove the routing information related to the adjacent router.

[0062] The second scenario, such as Figure 3As shown in the figure, the original topology is that the master router R1 is connected to the gateway, and the downstream routers are connected to slave routers R2, R3, and so on. Now the network parameters of the master router R1 are modified and it is restarted. During the restart process, the slave router R2 can detect the plug-in and unplug events (down / up events) of the port, which can trigger the re-networking. However, since the slave router R3 is connected to the slave router R2, there is no change in the port status between R2 and R3. Therefore, the slave router R3 cannot perceive the parameter changes of the master router R1 and accordingly cannot initiate detection. In other words, it cannot re-network and synchronize parameters with the master router R1 whose network parameters have been modified. In the related art, to solve this problem, during the restart of the master router R1, since it is impossible to send a message to the slave router R3 in a short period of time, the slave router R3 will wait for a routing aging time (for example, the aging time is 3 minutes), and then trigger re-networking with the master router R1. However, during the routing aging time, the master router R1 may have completed the restart and started working (for example, the restart is completed in 1 minute), while the slave router R3 is still waiting. Obviously, this method is relatively inefficient and cannot quickly identify and trigger re-detection of networking.

[0063] The third scenario, such as Figure 4 As shown, the original topology is that the master router R1 is connected to the gateway, and the slave routers R2 and R3 are connected downstream. Now, a router R3 is connected between the master router R1 and the gateway, making router R3 the master router and the old master router R1 a slave router. Currently, in this scenario, router R1 cannot automatically re-initiate detection, that is, it cannot downgrade itself to a slave router and form a network with the new master router R3. Instead, the user needs to manually configure router R1 to re-detect the network. Obviously, this method cannot quickly identify and trigger the re-detection of the network.

[0064] The fourth scenario, such as Figure 5As shown, the original topology is that the main router R1 is connected to the gateway, and the slave router R2 is connected downstream in sequence. If the networking switch is not turned on when the main router R1 is initially configured, after the slave router R2 is connected to the main router R1, the slave router R2 is assigned an IP address and performs a network detection. However, because the networking switch of the main router R1 is in the off state, even if the main router R1 receives the detection message, it will not reply with a detection response. Usually, the slave router R2 will detect the network within a period of time (such as within 1 minute), for example, once every 2 seconds, and 30 times in 1 minute. If no detection response is received within this period of time, the slave router R2 will confirm that the detection has timed out. If the networking switch of the main router R1 is turned on later, but because the detection of the slave router R2 has timed out, it will not re-initiate the detection. Currently, in this scenario, the user needs to manually configure the slave router R2 to re-detect the network. This method cannot quickly identify and trigger re-detection of the network. Alternatively, the slave router R2 can be configured to continuously detect the networking status of the master router R1. When it detects that the networking switch of the master router R1 is on, it initiates the detection of the network. However, this method will increase the power consumption of the slave router R2, wasting resources.

[0065] Therefore, for the above four scenarios where the network topology changes, the relevant technologies are unable to quickly identify the scenario of the network change and automatically re-detect the network. In view of this, the embodiments of the present application provide a method for detecting and networking a network device. When the master router changes, the slave router can quickly and timely detect the network through message interaction with the slave router to ensure the normal operation of the network. It is understood that in addition to the above four scenarios, the above-mentioned method for detecting and networking a network device can also be applied to other similar scenarios, which are not listed here one by one. For the convenience of description, the network device in the following embodiments is a router for illustration.

[0066] As can be seen from the description of the above scenario, each network topology structure involves interaction between the master router and the slave router, which is usually carried out through message interaction. The message can carry various information and requests of the device, so both the master router and the slave router should have the ability to manage and process messages. Based on this, the network device detection networking method provided in the embodiment of the present application can be applied to Figure 6 The system architecture shown in FIG. 4 may include a master router (controller) and multiple slave routers (agents). The master router may also be called a probed entity, and the slave routers may also be called probe initiators. The multiple slave routers may include the same module structure. Figure 6 The structure of a slave router is described as an example.

[0067] See also Figure 6, the main router may include a topology management module, a networking management module and a message processing module. The topology management module is used to manage the device node information of each router, such as saving the device node information with the media access control address (MAC address) of the router as the index, and storing the operating role information of each router, such as the operating role of the router itself is the main router role; and, when there is new device node information, when a topology message trigger is received from other routers, when the router is initialized, or when the networking switch state changes, the topology management module is also used to actively initiate corresponding topology notifications or messages, etc. The networking management module is used to receive a detection networking request from the slave router, and reply to the detection response information, etc. The message processing module is used to assemble detection messages and various topology messages, fill in the required field information, and parse the received detection messages and various topology messages, and parse the corresponding field information. In some implementations, the above-mentioned device node information and operating role information can be collectively referred to as topology information.

[0068] The slave router may include a topology management module, a networking management module, a message processing module, and a scenario recognition module. The topology management module is used to manage the device node information of each router, such as storing the device node information using the router's MAC address as an index, and storing the operating role information of each router, such as the router's own operating role as a slave router; and, upon receiving a topology message sent by the master router, triggering or replying to the corresponding topology message. The networking management module is used to provide different detection interfaces for different business scenarios, for example, whether the current network detection requires initiating a detection request on all ports or on a certain port (such as only on the wide area network (WAN) interface). The message processing module is used to assemble detection messages and various topology messages, fill in the required field information, and parse the received detection messages and various topology messages to parse the corresponding field information. The scenario recognition module is used to identify specific business scenarios based on the topology messages input by the topology management module, and, based on different business scenarios, call the networking management module to perform detection and networking according to different detection interfaces.

[0069] exist Figure 6Based on the system architecture shown, the master router in the embodiment of the present application can trigger the message processing module to initiate a corresponding topology message when the topology management module receives a topology message from the slave router or the node information of its own device changes. The message processing module assembles the topology message and sends it to the message processing module of the slave router. The message processing module of the slave router forwards the topology message to the topology management module. The topology management module can trigger a reply based on the content of the topology message, or output it to the scene recognition module. If a reply is triggered, the message processing module will interact with the message processing module of the master router through the message processing module; if it is output to the scene recognition module, the scene recognition module can identify the topology message, obtain a specific business scenario, and then call the network management module to initiate a detection network. In the process of detecting the network, the network management module of the slave router can send a detection message to the message processing module of the master router through the message processing module according to different detection interfaces. Finally, the network management module of the master router receives the detection message forwarded by the message processing module and replies with a detection response message to complete the process of detecting the network.

[0070] The topology messages exchanged between the master router and the slave router may include but are not limited to a topology discovery message (topo discovery), a topology notification message (topo notify), a topology query request message (topo query request) and a topology query reply message (topo query response).

[0071] A topology discovery message is a neighbor multicast message that a network device can send only to neighboring devices. By sending and parsing topology discovery messages, network devices can dynamically obtain the topology of their network, enabling better routing, switching, and fault diagnosis. Topology discovery messages can carry information such as device ID (such as MAC address), device type (such as router, switch), connection relationship (such as connection port), and protocol type.

[0072] A topology notification message (topo notify) is a relay multicast message. That is, a message sent by a network device can be received by all other devices in the network where the network device is located. When the device node information of a network device changes, it can notify other network devices to maintain the accuracy of the information.

[0073] Topology query request and topology query response messages are unicast messages. When network device A sends a topology query request message to network device B, network device B responds with a topology query response message. A topology query request message can be used to query a network device's topology information, while a topology query response message can carry the device's own node information (such as its MAC address) and operational role information.

[0074] Based on the introduction of the above system architecture and topology messages, the solutions of the embodiments of the present application for the scenarios where the above four networking topologies change will be described in detail below.

[0075] For the first scenario, after the master router R1 is replaced by R4, the slave router R2 can detect the port plug-in and unplug event (down / up event). At this time, the slave router R2 can send a topology message to the new master router R4 to subsequently trigger the slave router R3 to detect the network. The specific process can be seen in Figure 7 , including the following steps:

[0076] S11, the slave router R2 detects a port plugging and unplugging event.

[0077] Usually, because the slave router R2 is connected to the master router R1, when the master router R1 is replaced, the slave router R2 and the new master router R4 need to be connected again. For example, if an Internet cable is plugged in between the two routers, an Internet cable plug-in and unplug-out event will occur, and the slave router R2 will detect the plug-in and unplug-out event accordingly. Generally, because the Internet cable is unplugged first and then plugged in, the slave router R2 will first detect the down event and then the up event. It can be understood that since the slave router R2 needs to detect the plug-in and unplug-out events of the port in this step, in this scenario, the slave router R2 needs to have a wired connection with the master router R4, while other slave router connection methods are not restricted, for example, wired connection or wireless connection are applicable.

[0078] In some implementations, the networking management module in the slave router R2 may detect the plugging and unplugging events of the ports.

[0079] S12, the slave router R2 sends a topology discovery message to the master router R4.

[0080] That is, once slave router R2 detects a plug-in or unplug event, it sends a topology discovery message to the new master router R4, triggering subsequent message transmission from master router R4, ultimately triggering slave router R3 to re-establish a network with the new master router R4. The topology discovery message here can at least carry information such as the MAC address of slave router R2.

[0081] In some implementations, the message processing module in the slave router R2 may send a topology discovery message to the master router R4.

[0082] S13, the master router R4 parses the topology discovery message to determine whether the slave router R2 is a new device. If so, execute S14.

[0083] After receiving the topology discovery message, the master router R4 can parse the message to find the MAC address and other information carried in the message, and then search its own stored device list for information about the MAC address. If the master router R4 is newly connected, its own stored device list should not contain information about the slave router R2, so it can be determined that the slave router R2 is a new device.

[0084] In some implementations, the message processing module in the primary router R4 may parse the topology discovery message and transmit the parsing result to the topology management module.

[0085] S14, the main router R4 sends a topology notification message.

[0086] Because the master router R4 resolves that the slave router R2 is a new device, the slave router R2 and other slave routers may not record the information of the master router R4. Therefore, the master router R4 can send a topology notification message to notify other routers in the network.

[0087] It is understood that both slave routers R2 and R3 will receive the topology notification message sent by the master router R4. Since slave router R2 is directly connected to the master router R4 and has sensed the above-mentioned plug-in and unplug event, slave router R2 can directly initiate the detection network. Slave router R3 has not yet sensed the event that the master router R1 has been replaced by R4, so it can execute the following process when it receives the topology notification message sent by the master router R4. It is also understood that if there are other slave routers connected to the slave router R3, or other slave routers are connected in parallel, the other slave routers can execute the same process as the slave router R3.

[0088] In some implementations, the topology management module in the primary router R4 may trigger the message processing module to send the topology notification message.

[0089] S15, the slave router R3 receives the topology notification message and sends a topology query request message to the master router R4.

[0090] After receiving the topology notification message from the slave router R3, in order to re-establish the network between the slave router R3 and the master router R4, the slave router R3 needs to obtain the topology information of the master router R4, such as device node information and operation role information. Therefore, the slave router R3 can send a topology query request message to the master router R4 to query the topology information of the master router R4.

[0091] In some implementations, the message processing module of the slave router R3 may send a topology query request message to the master router R4.

[0092] S16, the master router R4 replies with a topology query reply message to the slave router R3.

[0093] When the main router R4 receives the topology query request message, it needs to reply the topology query reply message within a certain time (such as within 1 second). The message carries the device node information (such as MAC address) and operation role information of the main router R4 (here it should be the main router role).

[0094] S17, receiving the topology query reply message from router R3, performing scene recognition and initiating detection networking.

[0095] The process of scene recognition from router R3 based on the topology query reply message is as follows: Figure 11 The content of the illustrated embodiment.

[0096] In some implementations, after the message processing module of router R3 parses the topology query reply message, it can be sent to the topology management module. The topology management module outputs it to the scene recognition module based on the content of the message, and the scene recognition module then recognizes it to obtain a specific business scenario.

[0097] In the processing process of the first scenario above, when it is detected that the master router is replaced, through the interaction of several topology messages between the master router and the slave router, the slave router can quickly identify the network change scenario and automatically re-detect the network without waiting for the route aging time, which is highly efficient.

[0098] For the second scenario, after the network parameters of the master router R1 are modified and restarted, the master router R1 can recognize its own restart operation and send a topology message to the slave router R3 to subsequently trigger the slave router R3 to detect the network. Figure 8 , including the following steps:

[0099] S21, the master router R1 detects its own restart operation.

[0100] S22, the main router R1 sends a topology notification message.

[0101] Among them, network devices usually detect and record their own status. Therefore, when the main router R1 detects that it has been restarted, it can actively send a topology notification message to notify other routers in the network.

[0102] It is understandable that both slave routers R2 and R3 will receive the topology notification message sent by the master router R1. Since slave router R2 is directly connected to the master router R1 and will sense the plug-in and unplug event during the restart of the master router R1, slave router R2 can directly initiate the detection network. However, slave router R3 has not yet sensed the restart event of the master router R1, so it can execute the following process when it receives the topology notification message sent by the master router R1. It is also understandable that if there are other slave routers connected to the slave router R3, or other slave routers are connected in parallel, the other slave routers can execute the same process as the slave router R3.

[0103] In some implementations, the topology management module in the primary router R1 may trigger the message processing module to send the topology notification message.

[0104] S23, the slave router R3 receives the topology notification message and sends a topology query request message to the master router R1.

[0105] After receiving the topology notification message from the slave router R3, in order to enable the slave router R3 to re-establish the network with the master router R1 after the network parameters are modified, the slave router R3 needs to obtain the topology information of the master router R1, such as device node information and operation role information. Therefore, the slave router R3 can send a topology query request message to the master router R1 to query the topology information of the master router R1.

[0106] In some implementations, the message processing module of the slave router R3 may send a topology query request message to the master router R1.

[0107] S24, the master router R1 replies to the slave router R3 with a topology query reply message.

[0108] When the main router R1 receives the topology query request message, it needs to reply the topology query reply message within a certain time (such as within 1 second). The message carries the device node information (such as MAC address) and operation role information of the main router R1 (here it should be the main router role).

[0109] S25, receiving the topology query reply message from router R3, performing scene recognition and initiating detection networking.

[0110] The process of scene recognition from router R3 based on the topology query reply message is as follows: Figure 11The content of the illustrated embodiment.

[0111] In some implementations, after the message processing module of router R3 parses the topology query reply message, it can be sent to the topology management module. The topology management module outputs it to the scene recognition module based on the content of the message, and the scene recognition module then recognizes it to obtain a specific business scenario.

[0112] During the processing of the second scenario above, when the master router detects that the network parameters have been modified and restarts, through the interaction of several topology messages between the master router and the slave router, the slave router can quickly identify the networking change scenario and automatically re-detect the networking without waiting for the route aging time, which is highly efficient.

[0113] For the third scenario, after connecting another router R3 between the main router R1 and the gateway, router R3 should become the main router and router R1 should be demoted to a slave router. When connected to the main router R3, the slave router R1 should be able to detect the plug-in and unplug events (down / up events) of the port. At this time, the slave router R1 can send a topology message to the new main router R3 to subsequently trigger the slave router R1 to detect the network. The specific process can be seen in Figure 9 , including the following steps:

[0114] S31, the slave router R1 detects a port plugging and unplugging event.

[0115] Usually, since the slave router R1 is originally connected to the gateway, in the process of cascading a main router R3, it is necessary to disconnect the slave router R1 from the gateway and connect it to the main router R3. For example, if the network cable between the slave router R1 and the gateway is unplugged and then connected to the main router R3, a plug-in and unplug-out event of the network cable will occur, and the slave router R1 will detect the plug-in and unplug-out event accordingly. Generally, since the network cable is unplugged first and then plugged in, the slave router R1 will first detect the down event and then the up event. It can be understood that since the slave router R1 needs to detect the plug-in and unplugging event of the port in this step, in this scenario, the slave router R1 needs to have a wired connection with the main router R3, while other connection methods of the slave routers are not restricted, for example, wired connection or wireless connection are applicable.

[0116] In some implementations, the networking management module in the slave router R1 may detect the plugging and unplugging events of the ports.

[0117] S32, the slave router R1 sends a topology discovery message to the master router R3.

[0118] That is, once slave router R1 detects a plug-in or unplug event, it sends a topology discovery message to the new master router R3, triggering subsequent message transmission from master router R3, ultimately triggering the re-networking of slave router R1 and master router R3. The topology discovery message here can at least carry information such as the MAC address of slave router R1.

[0119] In some implementations, the message processing module in the slave router R1 may send a topology discovery message to the master router R3.

[0120] S33, the master router R3 parses the topology discovery message to determine whether the slave router R1 is a new device. If so, execute S34.

[0121] After receiving the topology discovery message, the master router R3 can parse the message to find the MAC address and other information carried in the message, and then search its stored device list for information about the MAC address. If the master router R3 is newly connected, its stored device list should not contain information about the slave router R1, so it can be determined that the slave router R1 is a new device.

[0122] In some implementations, the message processing module in the primary router R3 may parse the topology discovery message and transmit the parsing result to the topology management module.

[0123] S34, the main router R3 sends a topology notification message.

[0124] Because the master router R3 resolves that the slave router R1 is a new device, the slave router R1 and other slave routers may not record the information of the master router R3. Therefore, the master router R3 can send a topology notification message to notify other routers in the network.

[0125] It is understood that both slave routers R1 and R2 will receive the topology notification message sent by master router R3. Therefore, upon receiving the topology notification message, both slave routers R1 and R2 can execute the following process, which is described using slave router R1 as an example. It is also understood that if slave router R2 is connected to other slave routers, or connected in parallel with other slave routers, the other slave routers can execute the same process as slave router R1. However, the difference is that, for slave router R1, it has been downgraded from a master router to a slave router, and its operating role can be changed later, while the operating role of slave router R2 remains unchanged.

[0126] In some implementations, the topology management module in the primary router R3 may trigger the message processing module to send the topology notification message.

[0127] S35 , the slave router R1 receives the topology notification message and sends a topology query request message to the master router R3 .

[0128] After receiving the topology notification message from the slave router R1, in order to re-establish the network between the slave router R1 and the master router R3, the slave router R1 needs to obtain the topology information of the master router R3, such as device node information and operation role information. Therefore, the slave router R1 can send a topology query request message to the master router R3 to query the topology information of the master router R3.

[0129] In some implementations, the message processing module of the slave router R1 may send a topology query request message to the master router R3.

[0130] S36, the master router R3 replies to the slave router R1 with a topology query reply message.

[0131] When the main router R3 receives the topology query request message, it needs to reply to the topology query reply message within a certain time (such as within 1 second). The message carries the device node information (such as MAC address) and operation role information of the main router R3 (here it should be the main router role).

[0132] S37, receiving the topology query reply message from router R1, performing scene recognition and initiating detection networking.

[0133] The process of scene recognition from router R1 based on the topology query reply message is as follows: Figure 11 It is understood that when the slave router R1 detects the network, it can also automatically modify its own operating role information to the slave router role.

[0134] In some implementations, after the message processing module of router R1 parses the topology query reply message, it can be sent to the topology management module. The topology management module outputs the message to the scene recognition module based on the content of the message, and the scene recognition module then recognizes it to obtain a specific business scenario.

[0135] In the processing process of the third scenario above, a new master router is cascaded to the old master router. When the old master router is downgraded to a slave router, several topology message interactions between the new master router and the slave router can enable the slave router to quickly identify the network change scenario and automatically re-detect the network, without the need for manual configuration by the user, which is highly efficient.

[0136] For the fourth scenario, after the slave router R2 detects the timeout and turns on the networking switch of the master router R1, the master router R1 can recognize the switch operation and send a topology message to the slave router R2 to trigger the slave router R2 to detect the networking. Figure 10 , including the following steps:

[0137] S41, the networking switch of the main router R1 is in the off state.

[0138] S42: Router R2 initiates a network probe, but does not receive a probe response, confirming that the probe has timed out.

[0139] That is, after slave router R2 connects to master router R1, it is assigned an IP address and begins probing the network. However, because master router R1's networking switch is off, even if master router R1 receives a probe message, it will not respond. If slave router R2 does not receive a probe response within a certain period of time, it will be considered a probe timeout.

[0140] S43, the main router R1 detects that the networking switch is turned on.

[0141] S44, the main router R1 sends a topology notification message.

[0142] Among them, network devices usually detect and record their own status. Then, when the main router R1 detects that the networking switch is turned on at a certain moment, it can actively send a topology notification message to notify other routers in the network.

[0143] It's understandable that if slave router R2 is connected to other slave routers, or if other slave routers are connected in parallel, these other slave routers won't be able to complete the detection and networking process unless the master router R1's networking switch is initially turned on. Therefore, after the master router R1's networking switch is turned on, the other slave routers can perform the same process as slave router R2.

[0144] In some implementations, the topology management module in the primary router R1 may trigger the message processing module to send the topology notification message.

[0145] S45 , the slave router R2 receives the topology notification message and sends a topology query request message to the master router R1 .

[0146] After receiving the topology notification message from the slave router R2, in order to re-establish the network between the slave router R2 and the master router R1, the slave router R2 needs to obtain the topology information of the master router R1, such as device node information and operation role information. Therefore, the slave router R2 can send a topology query request message to the master router R1 to query the topology information of the master router R1.

[0147] In some implementations, the message processing module of the slave router R2 may send a topology query request message to the master router R1.

[0148] S46, the master router R1 replies a topology query reply message to the slave router R2.

[0149] When the main router R1 receives the topology query request message, it needs to reply the topology query reply message within a certain time (such as within 1 second). The message carries the device node information (such as MAC address) and operation role information of the main router R1 (here it should be the main router role).

[0150] S47, receiving a topology query reply message from router R2, performing scene recognition and initiating detection networking.

[0151] The process of scene recognition from router R2 based on the topology query reply message is as follows: Figure 11 The content of the illustrated embodiment.

[0152] In some implementations, after the message processing module of router R2 parses the topology query reply message, it can be sent to the topology management module. The topology management module outputs it to the scene recognition module based on the content of the message, and the scene recognition module then recognizes it to obtain a specific business scenario.

[0153] In the processing process of the fourth scenario above, when the master router detects that its own networking switch is turned on, through the interaction of several topology messages between the master router and the slave router, the slave router can quickly identify the networking change scenario and automatically re-detect the network, without the need for manual configuration by the user or continuous detection by the slave router, which is highly efficient and saves resources.

[0154] In the above four scenarios, message interaction is carried out. After the slave router receives the topology query reply message sent by the master router, the slave router can parse the message to trigger scene recognition and detect the network. It can be understood that the above four scenarios are introduced with different slave routers as examples, but the scene recognition process performed by different slave routers is the same. The following description takes a slave router as an example. Specifically, Figure 11 As shown in the figure, the process of scene recognition and network detection from the router includes:

[0155] S51, the slave router parses the topology query reply message to obtain the device node information and operation role information of the master router.

[0156] Because the topology query reply message carries the master router's device node information and operating role information, the slave router can parse this information. For example, the device node information includes the MAC address.

[0157] It can be understood that in the first scenario above, the device node information and operational role information parsed from router R3 is that of the primary router R4; in the second scenario above, the device node information and operational role information parsed from router R3 is that of the primary router R1; in the third scenario above, the device node information and operational role information parsed from router R1 is that of the primary router R3; and in the fourth scenario above, the device node information and operational role information parsed from router R2 is that of the primary router R1. Under normal circumstances, the operational role information parsed here should be that of the primary router.

[0158] S52, query the router to see if the device node information already exists, if yes, execute S53, if not, execute S54.

[0159] That is, the slave router will query whether the device node information obtained by the above analysis exists in its own stored device list. If it exists, it means that the corresponding master router is not a new device in the slave router, and the update operation in S53 can be performed. If it does not exist, it means that the corresponding master router is a new device in the slave router, and it is necessary to execute S54 to create this device node. In some implementations, the slave router can query whether the MAC address in the device node information already exists.

[0160] S53: Update the running role of the corresponding device node according to the running role information and save it.

[0161] After the stored running role is updated from the router, the subsequent step S55 can be executed.

[0162] S54, the slave router creates a device node according to the device node information, and initializes the running role of the device node to an initial value.

[0163] In the case that the slave router does not store the device node information obtained by the above analysis, the slave router can create a new device node corresponding to the device node information. At this time, its running role can be assigned to an initial value, such as none, and then the subsequent S55 step is executed.

[0164] S55, determining whether the running role corresponding to the device node is the initial value, and the running role information obtained by parsing is the master router role, if so, executing S56, otherwise discarding the message.

[0165] Because in the above four scenarios, whether it is replacing or cascading the main router, changing the network parameters of the main router, or turning on the networking switch of the main router, the main router should be a new device node relative to the slave router, then the corresponding step should be S54. At this time, the operating role corresponding to the device node is the initial value (that is, the operating role has not yet been updated to the parsed operating role information), but the operating role information parsed according to the above message is the main router role, indicating that the slave router is likely to re-detect the networking, and the slave router continues to execute the subsequent S56 step. If the operating role corresponding to the device node is not the initial value (such as the update step of S53 is executed), it means that the main router is not a new device node relative to the slave router and may not need to re-detect the networking, or, the parsed operating role information is not the main router role, indicating that the message may not be sent by the main router and there is no need to re-detect the networking.

[0166] It can be understood that the process of obtaining the running role information from the router by parsing the message can be performed in the above S51 or after S54, and the embodiment of the present application does not limit this.

[0167] S56, the slave router determines the business scenario category according to its own operation role information.

[0168] Since the slave router also stores its own running role information, the slave router can obtain its own running role information and then determine the current business scenario category according to its own running role information.

[0169] In some implementations, if the slave router's own operational role information indicates a slave router role, the scenario is determined to be the first or second scenario above. This is because, as can be seen from the description of the first or second scenario above, the master router R1 is replaced or restarted, and the slave router R3 has not changed and remains in the slave router role. If the slave router's own operational role information indicates a master router role, the scenario is determined to be the third scenario above. This is because, as can be seen from the description of the third scenario above, the master router R1 is demoted to a slave router, and the operational role information of the slave router R1 has not changed, remaining in the previous master router role. Optionally, the operational role information of the slave router can be updated after the business scenario category is determined. If the slave router's own operational role information indicates an initial value and a detection timeout record is confirmed, the scenario is determined to be the fourth scenario above. This is because, as can be seen from the description of the fourth scenario above, the slave router R2 did not successfully establish a network before the master router R1's networking switch was turned on. Therefore, the slave router R2 did not update its own operational role information and remains at the initial value.

[0170] S57, the slave router initiates a network detection to the master router based on the service scenario category.

[0171] Among them, the slave router can initiate detection networking from different ports according to different business scenario categories.

[0172] In some implementations, if it is the first scenario, the second scenario or the fourth scenario, the slave router can initiate a probe request from all ports or the plug-in port, because in addition to being connected to the upper-level router, the port of the slave router may also be connected to computer equipment, etc., but the slave router is not sure which port is connected to the router. Therefore, the slave router can initiate a probe request from all ports or the plug-in port, and after receiving the probe response from the port connected to the router, it will act as the slave router to complete the detection networking.

[0173] In the third scenario, the slave router can only initiate a probe request on the WAN port. This is because a master router is cascaded to the old master router, and the new master router can only be upstream of the old master router. Therefore, in this scenario, the slave router (i.e., the old master router) can only initiate a probe request on the upstream WAN port to improve detection efficiency. After receiving the probe response, the slave router will downgrade itself to the slave router role to complete the detection network.

[0174] In some implementations, the scene recognition process in the above steps S51-S56 can be performed by a scene recognition module in the slave router. After determining the service scene, the scene recognition module can call the networking management module to detect the network according to different detection interfaces.

[0175] In summary, the detection networking method for network devices proposed in the embodiment of the present application, when the main router is replaced, cascaded, restarted, or the networking switch is turned on, through message interaction with the slave router, the slave router can parse the message to quickly identify the scene and initiate detection networking in a timely manner. Compared with traditional technologies, it is more efficient and can enable the network to operate normally faster.

[0176] The above describes in detail an example of a detection networking method for a network device provided in an embodiment of the present application. It is understandable that, in order to implement the above functions, the network device includes hardware and / or software modules that perform the corresponding functions. Those skilled in the art should easily appreciate that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.

[0177] The embodiment of the present application can divide the functional modules of the network device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a parsing unit, etc., or two or more functions can be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0178] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0179] The network device provided in this embodiment is used to execute the detection networking method of the above-mentioned network device, and thus can achieve the same effect as the above-mentioned implementation method.

[0180] When integrated, the network device may also include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the network device's operations. The storage module may be used to support the network device's execution and storage of program code and data. The communication module may be used to support communication between the network device and other devices.

[0181] The processing module may be a processor or controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device such as a transceiver that exchanges messages with other network devices.

[0182] In the case of a router, the network device consists of a routing component and a packet forwarding component. The core component of the routing component is the routing processor. The routing processor's task is to construct a routing table based on the selected routing protocol and to continuously update and maintain the routing table by frequently or periodically exchanging routing information with neighboring routers. The packet forwarding component consists of three parts: a switching fabric, a set of input ports, and a set of output ports. The switching fabric processes packets according to the forwarding table and forwards packets entering a particular input port through an appropriate output port.

[0183] The present application also provides a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, the processor executes the network device detection and networking method of any of the above embodiments. The storage medium may include a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, among other media capable of storing program code.

[0184] An embodiment of the present application also provides a computer program product. When the computer program product is run on a network device, the network device is caused to execute the above-mentioned related steps to implement the detection networking method of the network device in the above-mentioned embodiment.

[0185] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory to enable the chip to execute the detection networking method of the network device in the above-mentioned method embodiments.

[0186] Among them, the network device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0187] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0188] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0189] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A detection networking method for a network device, the method being executed by a first network device, characterized in that: The method comprises: Upon receiving a first message from a second network device, sending a second message to the second network device, wherein the first message is a message sent by the second network device when a first condition is met, and the first condition includes: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or a networking switch is turned on; receiving a fourth message from the second network device in reply to the second message, the fourth message carrying device node information and operation role information of the second network device; According to the fourth message, the current business scenario of the first network device is determined, and a detection network is initiated to the second network device according to the business scenario.

2. The method according to claim 1, characterized in that The determining, according to the fourth message, the current service scenario of the first network device includes: Parsing the fourth message to obtain device node information and operating role information of the second network device; The current business scenario of the first network device is determined based on the device node information and the operating role information of the second network device and the operating role information of the first network device.

3. The method according to claim 2, characterized in that The determining, based on the device node information and the operating role information of the second network device and the operating role information of the first network device, the current service scenario of the first network device includes: When it is determined that the device node information of the second network device does not exist in the first network device, creating a corresponding device node according to the device node information of the second network device, and initializing the operation role of the device node to an initial value; If the operating role of the device node is an initial value, and the parsed operating role information of the second network device is a master router role, the current service scenario of the first network device is determined according to the operating role information of the first network device.

4. The method according to claim 3, characterized in that The determining, according to the operation role information of the first network device, the current service scenario of the first network device includes: If the operating role information of the first network device is a slave router role, determining that the current service scenario of the first network device is the first scenario or the second scenario, the first scenario represents a scenario in which the second network device is a newly replaced master router, and the second scenario represents a scenario in which the second network device is restarted; If the operating role information of the first network device is a master router role, determining that the current service scenario of the first network device is a third scenario, wherein the third scenario represents a scenario in which the first network device is an old master router and the second network device is a new master router cascaded on the first network device; If the operating role information of the first network device is the initial value and a detection timeout has occurred, it is determined that the current business scenario of the first network device is the fourth scenario, and the fourth scenario represents the scenario in which the networking switch of the second network device is turned on after the first network device detects the networking timeout.

5. The method according to claim 4, characterized in that The initiating a detection network to the second network device according to the service scenario includes: When the service scenario is the first scenario, the second scenario, or the fourth scenario, the first network device initiates a detection network on all ports, and completes the networking after receiving a detection response from the second network device; When the business scenario is the third scenario, the first network device initiates a detection network at the wide area network interface WAN port, and completes the networking after receiving a detection response from the second network device.

6. The method according to any one of claims 2 to 5, characterized in that The device node information of the second network device includes a media access control address (MAC address) of the second network device.

7. The method according to any one of claims 1 to 6, characterized in that When the first condition is that the second network device receives a third message from the first network device or the third network device, the third message is a message sent by the first network device or the third network device when detecting a port plugging and unplugging event.

8. The method according to claim 7, characterized in that The third message is a topology discovery message.

9. The method according to any one of claims 1 to 8, characterized in that The first message is a topology notification message.

10. A detection networking method for a network device, the method being executed by a second network device, characterized in that: The method comprises: Sending a first message to the first network device when a first condition is met, the first condition including: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or the networking switch is turned on; receiving a second message from the first network device, and replying a fourth message to the first network device in response to the second message, wherein the fourth message carries device node information and operating role information of the second network device; Receive a detection networking request from the first network device and reply a detection response to the first network device, wherein the detection networking request is a request initiated according to the business scenario after the first network device determines the current business scenario of the first network device according to the fourth message.

11. The method according to claim 10, characterized in that When the second network device receives a third message from the first network device or the third network device, the method further includes: parsing the third message to determine whether the first network device or the third network device is a new device; Accordingly, the sending of the first message to the first network device includes: When the first network device or the third network device is a new device, the first message is sent to the first network device.

12. A first network device, characterized in that: The first network device includes: a message processing module, configured to receive a first message from a second network device, wherein the first message is a message sent by the second network device when a first condition is met, the first condition including: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or a networking switch is turned on; a topology management module, configured to trigger the message processing module to send a second message to the second network device; The message processing module is further configured to receive a fourth message from the second network device in reply to the second message, wherein the fourth message carries device node information and operation role information of the second network device; Network management module, used to provide different detection interfaces for different business scenarios; A scenario identification module is used to determine the current business scenario of the first network device based on the fourth message, and according to the business scenario, call the networking management module to initiate a detection network to the second network device according to different detection interfaces.

13. A second network device, characterized in that: The second network device includes: a message processing module, configured to send a first message to the first network device when a first condition is met, the first condition including: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or a networking switch is turned on; The message processing module is further configured to receive a second message from the first network device; a topology management module, configured to trigger the message processing module to reply a fourth message to the first network device in response to the second message, wherein the fourth message carries device node information and operation role information of the second network device; The network management module is used to receive a detection network request from the first network device and reply a detection response to the first network device. The detection network request is a request initiated according to the business scenario after the first network device determines the current business scenario of the first network device based on the fourth message.

14. A first network device, characterized in that: The first network device includes: a transceiver, configured to send a second message to a second network device upon receiving a first message from the second network device, wherein the first message is a message sent by the second network device when a first condition is met, and the first condition includes: the second network device receives a third message from the first network device or a third network device, or the second network device detects that the device is restarted or a networking switch is turned on; The transceiver is further configured to receive a fourth message from the second network device in reply to the second message, wherein the fourth message carries device node information and operation role information of the second network device; The processor is used to determine the current business scenario of the first network device based on the fourth message, and initiate a detection network to the second network device based on the business scenario.

15. A second network device, characterized in that: The second network device includes: a transceiver, configured to send a first message to a first network device when a first condition is met, the first condition comprising: the second network device receiving a third message from the first network device or a third network device, or the second network device detecting that the device is restarted or a networking switch is turned on; The transceiver is further configured to receive a second message from the first network device, and reply to the first network device with a fourth message in response to the second message, wherein the fourth message carries device node information and operation role information of the second network device; The transceiver is also used to receive a detection networking request from the first network device and reply a detection response to the first network device. The detection networking request is a request initiated according to the business scenario after the first network device determines the current business scenario of the first network device based on the fourth message.

16. A chip system, characterized in that: The chip system is applied to a network device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions to enable the network device to execute the method as described in any one of claims 1 to 9, or execute the method as described in any one of claims 10 to 11.

17. A computer-readable storage medium, characterized in that The computer-readable storage medium includes instructions, and when the instructions are executed on a network device, the network device is caused to perform the method according to any one of claims 1 to 9 or the method according to any one of claims 10 to 11.

Citation Information

Patent Citations

  • Update method and device for multicast list in the change of switching network topology

    CN101009628A

  • Router, wireless sensing network and method for monitoring terminal node

    CN102571573A

  • Automatic network topology generation device based on iterative TTL-IPID data package classification

    CN103117877A

  • Topology discovery in a hybrid network

    CN103765835A

  • Routing advertisement method and equipment

    CN103825827A