Configuration method and related device
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-08-13
Smart Images

Figure CN2025130792_13082026_PF_FP_ABST
Abstract
Description
A configuration method and related equipment
[0001] This application claims priority to Chinese Patent Application No. 202510131963.3, filed on February 5, 2025, entitled "A Configuration Method and Related Equipment", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of computers, and more particularly to a configuration method and related equipment. Background Technology
[0003] With the rapid development of digital transformation, all industries are undergoing tremendous changes. As the pipeline that carries these upper-level businesses and data, the network is becoming increasingly complex. Traditional methods of planning, building, maintaining, and optimizing campus networks are no longer able to meet the new challenges brought about by digitalization.
[0004] In the park's network, when equipment malfunctions, staff not only need to replace the faulty equipment with a new one, but also need to configure and debug the new equipment to ensure it works properly, which is very time-consuming and inconvenient. Summary of the Invention
[0005] This application provides a configuration method and related equipment, which can improve network maintenance efficiency by eliminating the need for manual configuration and debugging of new equipment when replacing existing equipment.
[0006] The first aspect of this application provides a configuration method:
[0007] The first network device obtains the configuration file of the second network device. The first network device also obtains the first neighbor information of the third network device. This first neighbor information indicates that the second network device and the third network device's first interface are connected, and the neighbor interface of the first interface is in a down state. The first network device then obtains the second neighbor information of the third network device. This second neighbor information indicates that the fourth network device and the third network device's first interface are connected, and the neighbor interface of the first interface is in an up state. Based on the first and second neighbor information, the first network device sends the configuration file to the fourth network device.
[0008] In this scheme, the first network device is the management device in the network, capable of centrally managing and controlling the configuration and operating status of the entire network. The second network device is the faulty device, the third network device is the device directly connected to the faulty device, and the fourth network device is the new device replacing the faulty device. The third network device can obtain the neighbor information transmitted by the faulty device and record a neighbor information entry based on it. This neighbor information indicates that the faulty device is connected to a certain interface of the third network device. Since the faulty device is still online at this time, the neighbor information records that the neighbor interface status of that interface is UP. When the faulty device is powered down, the third network device sets the neighbor interface status of that interface in the above neighbor information to down, that is, obtains the first neighbor information. When the new device replacing the faulty device is powered on, since the new device and the faulty device are located in the same position in the network, the third network device records another neighbor information entry based on the neighbor information transmitted by the new device. This neighbor information indicates that the new device is also connected to the above interface, and the neighbor interface status of that interface is UP, that is, the second neighbor information. Since only one device can be connected to the same interface of a network device at a time, the first network device can determine that a device replacement has occurred based on the above two neighbor information. The device with the neighbor interface status of UP is the new device. Therefore, the first network device will send the configuration file obtained from the faulty device in advance to the new device, so that there is no need for manual debugging and configuration on the new device, thus improving network maintenance efficiency.
[0009] In one possible implementation, the method also includes:
[0010] The first network device obtains the first software information of the second network device and the second software information of the fourth network device. If the first network device determines that the first software information and the second software information meet the preset conditions, it sends a configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
[0011] In this solution, the preset condition can be set to the condition that the fourth network device is compatible with the configuration file of the second network device. The configuration file will only be sent to the fourth network device if the fourth network device is compatible, thus avoiding unnecessary overhead.
[0012] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0013] In this solution, the software information includes the software version number and patch information. Based on these two parts of information, it is possible to effectively determine whether the fourth network device is compatible with the configuration file of the second network device.
[0014] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0015] In this solution, the accuracy of the judgment is ensured by determining whether the fourth network device is compatible with the configuration file of the second network device through the software version number.
[0016] In one possible implementation, the first network device obtains first neighbor information and second neighbor information through the constrained application protocol (COAP).
[0017] In this solution, the first network device can automatically obtain the first neighbor information and the second neighbor information from the third network device through the COAP protocol, without manual operation, thus improving the efficiency of configuration.
[0018] In one possible implementation, the first network device obtains the configuration file of the second network device via File Transfer Protocol (FTP), SSH File Transfer Protocol (SFTP), or Hypertext Transfer Protocol (HTTP).
[0019] In this solution, the first network device can automatically obtain the configuration file of the second network device through various protocols, eliminating the need for manual periodic backups and improving configuration efficiency.
[0020] In one possible implementation, the method also includes:
[0021] The first network device sends a policy action to the fourth network device so that the fourth network device executes the policy action and the configuration file takes effect.
[0022] In this scheme, the first network device will also send policy actions to the fourth network device to ensure that the fourth network device can apply the configuration file.
[0023] A second aspect of this application provides a configuration method:
[0024] The first network device obtains the configuration file of the second network device. The first network device also obtains first neighbor information, which indicates that the second network device should connect to the first network device's first interface, and that the neighbor interface of the first interface is in a down state. The first network device then obtains second neighbor information, which indicates that the third network device should connect to the first network device's first interface, and that the neighbor interface of the first interface is in an up state. Based on the first and second neighbor information, the first network device sends the configuration file to the third network device.
[0025] In this scheme, the first network device is the management device in the network, capable of centrally managing and controlling the configuration and operating status of the entire network. The second network device is the faulty device, and the third network device is the new device replacing the faulty device. The first network device can obtain the neighbor information transmitted by the faulty device and record a neighbor information entry based on it. This neighbor information indicates that the faulty device is connected to a certain interface of the first network device. Since the faulty device is still online at this time, the neighbor information records that the neighbor interface status of that interface is UP. When the faulty device is powered down, the first network device sets the neighbor interface status of that interface in the aforementioned neighbor information to down, i.e., obtains the first neighbor information. When the new device replacing the faulty device is powered on, since the new device and the faulty device are located in the same position in the network, the first network device records another neighbor information entry based on the neighbor information transmitted by the new device. This neighbor information indicates that the new device is also connected to the aforementioned interface, and the neighbor interface status of that interface is UP, i.e., the second neighbor information. Since only one device can be connected to the same interface of a network device at a time, the first network device can determine that a device replacement has occurred based on the above two neighbor information. The device with the neighbor interface status of UP is the new device. Therefore, the first network device will send the configuration file obtained from the faulty device in advance to the new device, so that there is no need for manual debugging and configuration on the new device, thus improving network maintenance efficiency.
[0026] In one possible implementation, the method also includes:
[0027] The first network device obtains the first software information of the second network device and the second software information of the third network device. If the first network device determines that the first software information and the second software information meet the preset conditions, it sends a configuration file to the third network device based on the first neighbor information and the second neighbor information.
[0028] In this solution, the preset condition can be set to the condition that the fourth network device is compatible with the configuration file of the second network device. The configuration file will only be sent to the fourth network device if the fourth network device is compatible, thus avoiding unnecessary overhead.
[0029] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0030] In this solution, the software information includes the software version number and patch information. Based on these two parts of information, it is possible to effectively determine whether the fourth network device is compatible with the configuration file of the second network device.
[0031] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0032] In this solution, the accuracy of the judgment is ensured by determining whether the fourth network device is compatible with the configuration file of the second network device through the software version number.
[0033] In one possible implementation, the first network device obtains first neighbor information and second neighbor information through the link layer discovery protocol (LLDP).
[0034] In this solution, the first network device can automatically obtain information about the first and second neighbors through the LLDP protocol, without manual operation, thus improving configuration efficiency.
[0035] In one possible implementation, the first network device obtains the configuration file of the second network device via File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), or Hypertext Transfer Protocol (HTTP).
[0036] In one possible implementation, the method also includes:
[0037] The first network device sends a policy action to the fourth network device so that the fourth network device executes the policy action and the configuration file takes effect.
[0038] In this scheme, the first network device will also send policy actions to the fourth network device to ensure that the fourth network device can apply the configuration file.
[0039] A third aspect of this application provides a network device, including an acquisition unit and a transmission unit:
[0040] The acquisition unit is used to acquire the configuration file of the second network device.
[0041] The acquisition unit is also used to acquire first neighbor information of the third network device. The first neighbor information is used to indicate that the second network device is connected to the first interface of the third network device, and the status of the neighbor interface of the first interface is down.
[0042] The acquisition unit is also used to acquire the second neighbor information of the third network device. The second neighbor information is used to indicate that the fourth network device is connected to the first interface of the third network device, and the state of the neighbor interface of the first interface is up.
[0043] The sending unit is used to send a configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
[0044] In one possible implementation,
[0045] The acquisition unit is also used to acquire the first software information of the second network device and the second software information of the fourth network device;
[0046] The sending unit is specifically used to send a configuration file to the fourth network device based on the first neighbor information and the second neighbor information if it is determined that the first software information and the second software information meet the preset conditions.
[0047] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0048] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0049] In one possible implementation,
[0050] The acquisition unit is specifically used to acquire information about the first neighbor and the second neighbor via COAP.
[0051] In one possible implementation,
[0052] The acquisition unit is specifically used to obtain the configuration file of the second network device via FTP, SFTP, or HTTP.
[0053] In one possible implementation,
[0054] The sending unit is also used to send policy actions to the fourth network device so that the fourth network device can execute the policy actions and make the configuration file effective.
[0055] A fourth aspect of this application provides a network device, including an acquisition unit and a transmission unit:
[0056] The acquisition unit is used to acquire the configuration file of the second network device.
[0057] The acquisition unit is also used to acquire first neighbor information, which is used to indicate that the second network device is connected to the first interface of the first network device, and the status of the neighbor interface of the first interface is down.
[0058] The acquisition unit is also used to acquire second neighbor information, which is used to indicate that the third network device is connected to the first interface of the first network device, and the state of the neighbor interface of the first interface is up.
[0059] The sending unit is used to send a configuration file to a third network device based on the first neighbor information and the second neighbor information.
[0060] In one possible implementation,
[0061] The acquisition unit is also used for the first network device to acquire the first software information of the second network device and the second software information of the third network device;
[0062] The sending unit is specifically used to send a configuration file to the third network device based on the first neighbor information and the second neighbor information if it is determined that the first software information and the second software information meet the preset conditions.
[0063] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0064] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0065] In one possible implementation,
[0066] The acquisition unit is specifically used to acquire information about the first neighbor and the second neighbor through LLDP.
[0067] In one possible implementation,
[0068] The acquisition unit is specifically used to obtain the configuration file of the second network device via FTP, SFTP, or HTTP.
[0069] In one possible implementation,
[0070] The sending unit is also used to send policy actions to the third network device so that the third network device can execute the policy actions and make the configuration file effective.
[0071] A fifth aspect of this application provides a network device including a processor and a memory, the processor being configured to execute instructions stored in the memory to cause the network device to perform the methods described in the first or second aspect above.
[0072] A sixth aspect of this application provides a computer-readable storage medium including computer program instructions that, when executed, perform the method described in any of the preceding aspects.
[0073] The seventh aspect of this application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the method as described in any of the preceding aspects. Attached Figure Description
[0074] Figure 1 is a schematic diagram of a network scenario provided in an embodiment of this application;
[0075] Figure 2 is a flowchart illustrating a configuration method provided in an embodiment of this application.
[0076] Figure 3 is a network diagram provided in an embodiment of this application;
[0077] Figure 4 is another network topology diagram provided in an embodiment of this application;
[0078] Figure 5 is a flowchart illustrating a configuration method provided in an embodiment of this application.
[0079] Figure 6 is another network topology diagram provided in an embodiment of this application;
[0080] Figure 7 is another flowchart illustrating the configuration method provided in an embodiment of this application;
[0081] Figure 8 is a structural schematic diagram of a network device provided in an embodiment of this application;
[0082] Figure 9 is another structural schematic diagram of the network device provided in an embodiment of this application. Detailed Implementation
[0083] The embodiments of this application are described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. As those skilled in the art will recognize, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0084] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0085] To facilitate understanding of this application, the relevant concepts involved in this application will be introduced below:
[0086] LLDP: Link Layer Discovery Protocol defined in IEEE 802.1ab. LLDP is a standard Layer 2 discovery method that organizes information such as the management address, device identifier, and interface identifier of a local device and publishes it to its neighboring devices. After receiving this information, the neighboring devices save it in the form of a standard management information base (MIB) for the network management system to query and determine the communication status of the link.
[0087] COAP: A lightweight application-layer communication protocol designed for resource-constrained environments (such as IoT devices) to enable efficient data transmission between devices.
[0088] Electronic serial number (ESN): A serial number used to uniquely identify an electronic device, similar to a device's "ID number".
[0089] Media access control address (MAC): A unique identifier used to identify network devices. It is used for communication between devices in a local area network (LAN) and some wide area networks (WAN).
[0090] This application embodiment can be applied to network scenarios in small and medium-sized local area network (LAN) campuses. Referring to Figure 1, the network includes, for example, firewalls and various LAN switches (LSWs), such as core switches, aggregation switches, access switches, and access points (APs) or wired terminals under the access switches. This network includes a switch used as a management device, such as the core switch, while other devices are managed as member devices. When a switch in the network fails, manual replacement is required. For example, if aggregation switch A fails, aggregation switch A' is manually replaced with aggregation switch A, or if access switch A fails, access switch A' is manually replaced with access switch A. The management device can centrally manage and control the configuration and operating status of the entire network, thereby enabling manual configuration and replacement of faulty devices. It should be noted that the network shown in Figure 1 is only an illustration and should not be construed as a limitation of this application. For example, in another network configuration, the access switch can be replaced with an access router (AR).
[0091] Please refer to Figure 2. The following is a flowchart of the configuration method in this embodiment. The first network device in this embodiment is, for example, the core switch shown in Figure 1, the second network device is, for example, the aggregation switch A shown in Figure 1, and the third network device is, for example, the aggregation switch A'.
[0092] 201. The first network device obtains the configuration file of the second network device;
[0093] Please refer to Figure 3. For example, the core switch's local interface is ethernet0 / 0 / 1, its local MAC address is 00:00:00:00:01, its local IP address is 1.1.1.1, and its local ESN is H1NW60JDD54211; the aggregation switch A's local interfaces include ethernet0 / 0 / 2, ethernet1 / 0 / 2, and ethernet1 / 0 / 3, with a local MAC address of 00:00:00:00:02 and a local IP address of 1.1.1.2. The ESN number is H1NW60JDD54212; the local interface of access switch A is ethernet0 / 0 / 3, the local MAC address is 00:00:00:00:03, the local IP address is 1.1.1.3, and the local ESN number is H1NW60JDD54213; the local interface of access switch B is ethernet0 / 0 / 4, the local MAC address is 00:00:00:00:04, the local IP address is 1.1.1.4, and the local ESN number is H1NW60JDD54214. The neighbor interface of the core switch's interface ethernet0 / 0 / 1 is the interface ethernet0 / 0 / 2 of aggregation switch A; the neighbor interface of aggregation switch A's interface ethernet1 / 0 / 2 is the interface ethernet0 / 0 / 3 of access switch A; and the neighbor interface of aggregation switch A's interface ethernet1 / 0 / 3 is the interface ethernet0 / 0 / 4 of access switch B.
[0094] Switches in the network enable the LLDP protocol by default. The switch encapsulates information such as the main capabilities, management address, device identifier, and interface identifier of the local device into LLDP messages and passes them to neighboring nodes. The neighboring nodes save this information after receiving it.
[0095] The following section describes the local and neighbor information stored on each switch after exchanging neighbor information.
[0096] Please refer to Table 1, which contains the local and neighbor information stored on the core switch:
[0097] Table 1
[0098] As shown in Table 1, since the core switch and aggregation switch A are neighbors, the neighbor information of the core switch includes the relevant information of aggregation switch A. Here, aggregation switch A has not yet failed, so for the core switch, its neighbor interface status is UP.
[0099] Please refer to Table 2, which shows the local and neighbor information stored on aggregation switch A:
[0100] Table 2
[0101] As shown in Table 2, since aggregation switch A is a neighbor of core switch, access switch A and access switch B, the neighbor information of aggregation switch A includes relevant information of core switch, access switch A and access switch B.
[0102] Please refer to Table 3, which shows the local information and neighbor information stored on access switch A:
[0103] Table 3
[0104] As shown in Table 3, since access switch A and aggregation switch A are neighbors, the neighbor information of access switch A includes the relevant information of aggregation switch A.
[0105] Please refer to Table 4, which shows the local and neighbor information stored on access switch B:
[0106] Table 4
[0107] As shown in Table 4, since access switch B and aggregation switch A are neighbors, the neighbor information of access switch A includes the relevant information of aggregation switch A.
[0108] In addition, since aggregation switch A, access switch A, and access switch B are member devices, they periodically report their locally stored local information and neighbor information to the core switch via the COAP protocol. Therefore, the core switch stores the local information and neighbor information of each device in the network. Furthermore, the core switch uses a heartbeat mechanism with each member device to determine their online status. The core switch and member devices periodically send lightweight messages (called "heartbeat packets" or "heartbeat signals") to confirm each other's status and connection availability. If one party does not receive a heartbeat signal from the other within a predetermined time, it can be determined that the other party may be offline. Please refer to Table 5, which shows the local information and neighbor information of all devices in the network stored on the core switch.
[0109] Table 5
[0110] The core switch issues management policies to each member device. These policies instruct member devices to report their local configuration files to the management device and, when a configuration file changes, to report the updated configuration file. This allows the management device to obtain the latest configuration files from each member device. Member devices can send configuration files to the management device via FTP, SFTP, or HTTP protocols. The configuration file format can be a text file or other formats, such as binary files; the specific format is not limited here.
[0111] 202. The first network device obtains the first neighbor information, which is used to indicate that the second network device is connected to the first interface of the first network device, and the status of the neighbor interface of the first interface is down;
[0112] When aggregation switch A fails, it is manually replaced by aggregation switch A'. After aggregation switch A is powered down, the core switch determines that it is offline based on a heartbeat mechanism. Therefore, it changes the status of aggregation switch A to offline and changes the neighbor interface status of the ethernet0 / 0 / 1 interface to down in the core switch's neighbor information. Similarly, access switches A and B can also determine that aggregation switch A is offline and change the corresponding neighbor interface status to down in their neighbor information. After updating their neighbor information, access switches A and B will proactively report the updated neighbor information to the core switch. Therefore, the information stored on the core switch is shown in Table 6 below:
[0113] Table 6
[0114] 203. The first network device obtains the second neighbor information of the third network device. The second neighbor information is used to indicate that the fourth network device is connected to the first interface of the third network device, and the status of the neighbor interface of the first interface is up.
[0115] Please refer to Figure 4. Taking aggregation switch A' as an example, its local interfaces include ethernet0 / 0 / 5, ethernet1 / 0 / 4, and ethernet1 / 0 / 5, its local MAC address is 00:00:00:00:05, its local IP address is 1.1.1.5, and its local ESN is H1NW60JDD54215. The neighbor interface of ethernet0 / 0 / 5 is ethernet0 / 0 / 1, the neighbor interface of ethernet1 / 0 / 4 is ethernet0 / 0 / 3, and the neighbor interface of ethernet1 / 0 / 5 is ethernet0 / 0 / 4. When aggregation switch A' is powered on, it exchanges neighbor information with the core switch, access switch A, and access switch B via the LLDP protocol. Taking the core switch as an example, the local information and neighbor information stored on the core switch at this time are shown in Table 7 below:
[0116] Table 7
[0117] As shown in Table 7, the core switch will not directly overwrite the neighbor information about aggregation switch A with the neighbor information about aggregation switch A'.
[0118] 204. The first network device sends a configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
[0119] The core switch matches the two neighbor information entries for aggregation switch A and aggregation switch A'. It finds that two different devices (different MAC addresses or different ESNs) are connected to the ethernet0 / 0 / 1 interface, with one device's interface status being down and the other's being up. The core switch can then determine that aggregation switch A' is in the same location as aggregation switch A, and therefore sends the previously obtained configuration file of aggregation switch A to aggregation switch A'. Optionally, the core switch can also obtain the software information of aggregation switches A and A', including software version numbers and patch information. The core switch only sends the configuration file to aggregation switch A' if it determines that aggregation switch A' is compatible with aggregation switch A's configuration file, for example, if aggregation switch A's software version number is greater than or equal to aggregation switch A's software version number.
[0120] After the core switch sends the above configuration file to the aggregation switch A', it further sends policy actions to the aggregation switch A', such as instructing the aggregation switch A' to restart and setting it to read the configuration file on the next startup, so that the aggregation switch A' will automatically take effect after restarting without manual configuration and debugging.
[0121] In this embodiment, when the management device is directly connected to the faulty device, the management device can obtain the neighbor information transmitted by the faulty device. Based on this, the management device records a neighbor information entry, which indicates that the faulty device is connected to a certain interface of the management device. Since the faulty device is still online at this time, the neighbor interface status of that interface is recorded as UP in the neighbor information. When the faulty device is powered down, the management device sets the neighbor interface status of that interface in the above neighbor information to down, that is, obtains the first neighbor information. When the new device that replaces the faulty device is powered on, since the new device and the faulty device are located in the same position in the network, the management device records another neighbor information entry based on the neighbor information transmitted by the new device. This neighbor information indicates that the new device is also connected to the above interface, and the neighbor interface status of that interface is UP, that is, the second neighbor information. Since only one device can be connected to the same interface of the management device at the same time, the management device can determine that a device replacement has occurred based on the above two neighbor information entries, and the device with the neighbor interface status of UP is the new device. Therefore, the management device sends the configuration file obtained from the faulty device in advance to the new device, thus eliminating the need for manual debugging and configuration on the new device.
[0122] Please refer to Figure 5. The following is a flowchart of the configuration method in this embodiment. The first network device in this embodiment is, for example, the core switch shown in Figure 1, the second network device is, for example, the access switch A shown in Figure 1, the third network device is, for example, the aggregation switch A, and the fourth network device is, for example, the access switch A' shown in Figure 1.
[0123] 501. The first network device obtains the configuration file of the second network device;
[0124] This step is similar to the one described in step 201 above, and will not be repeated here.
[0125] 502. The first network device obtains the first neighbor information of the third network device. The first neighbor information is used to indicate that the second network device is connected to the first interface of the third network device, and the status of the neighbor interface of the first interface is down.
[0126] When access switch A fails, it is manually replaced by access switch A'. After access switch A is powered down, the core switch determines that aggregation switch A is offline based on a heartbeat mechanism, and therefore changes the status of access switch A to offline. Similarly, aggregation switch A can also determine that access switch A is offline and changes the status of the corresponding neighbor interface to down in the neighbor information. The information stored on aggregation switch A at this time is shown in Table 8 below:
[0127] Table 8
[0128] As shown in Table 8, at this time, aggregation switch A changes the neighbor interface status of Ethernet1 / 0 / 2 interface to down.
[0129] After the neighbor information of aggregation switch A is updated, it will actively report the updated neighbor information to the core switch. Therefore, the information stored on the core switch is shown in Table 9 below:
[0130] Table 9
[0131] 503. The first network device obtains the second neighbor information of the third network device. The second neighbor information is used to indicate that the fourth network device is connected to the first interface of the third network device, and the status of the neighbor interface of the first interface is up.
[0132] Please refer to Figure 6. Taking access switch A' with local interface ethernet0 / 0 / 6, local MAC address 00:00:00:00:06, local IP address 1.1.1.6, and local ESN H1NW60JDD54216 as an example, and ethernet0 / 0 / 6's neighbor interface ethernet1 / 0 / 2 as an example, after access switch A' powers on, access switch A' exchanges neighbor information with aggregation switch A via the LLDP protocol. The information stored on aggregation switch A is shown in Table 10 below:
[0133] Table 10
[0134] As shown in Table 10, the neighbor information about access switch A will not be directly overwritten by the neighbor information about access switch A' on aggregation switch A.
[0135] Similarly, after updating its neighbor information, aggregation switch A proactively reports the updated neighbor information to the core switch. The core switch can also obtain the local information and neighbor information of access switch A' through the COAP protocol. The information stored on the core switch is shown in Table 11 below:
[0136] 504. The first network device sends a configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
[0137] The core switch matches two neighbor information entries on aggregation switch A regarding access switch A and access switch A'. It discovers that two different devices (different MAC addresses or different ESNs) are connected to the ethernet1 / 0 / 2 interface, with one device's interface status being down and the other's being up. The core switch can then determine that access switch A' is in the same location as access switch A previously, and therefore sends the previously obtained configuration file of access switch A to access switch A'. Optionally, the core switch can also obtain software information for access switches A and A', including software version numbers and patch information. The core switch only sends the configuration file to access switch A' if it determines that access switch A' is compatible with access switch A's configuration file, for example, if access switch A's software version number is greater than or equal to access switch A's software version number. After sending the configuration file to access switch A', the core switch further sends policy actions to access switch A', such as instructing access switch A' to restart and configure it to read the configuration file upon the next startup. This ensures that access switch A' automatically applies the configuration file after restarting, without requiring manual configuration or debugging.
[0138] In this embodiment, when a network device is directly connected to a faulty device, the network device can obtain neighbor information transmitted by the faulty device. Based on this, the network device records a neighbor information entry, indicating that the faulty device is connected to a certain interface of the management device. Since the faulty device is still online at this time, the neighbor information records that the neighbor interface status of that interface is UP. When the faulty device is powered off, the network device sets the neighbor interface status of that interface in the aforementioned neighbor information to down, i.e., obtains the first neighbor information. When a new device replacing the faulty device is powered on, since the new device and the faulty device are located in the same position in the network, the network device records another neighbor information entry based on the neighbor information transmitted by the new device. This neighbor information indicates that the new device is also connected to the aforementioned interface, and the neighbor interface status of that interface is UP, i.e., the second neighbor information. Since only one device can be connected to the same interface of a network device at a time, the management device can determine that a device replacement has occurred based on the above two neighbor information entries, and the device with the neighbor interface status UP is the new device. Therefore, the management device sends the configuration file obtained from the faulty device in advance to the new device, thus eliminating the need for manual debugging and configuration on the new device.
[0139] Please refer to Figure 7. The following describes another process of the configuration method in this embodiment:
[0140] 701. Power on switch A (hardware installation);
[0141] 702. Management device discovered switch A;
[0142] The management devices in the network obtain the device information of switch A through the COAP protocol, including the MAC address and ESN of switch A.
[0143] 703. The management device assigns a management address to switch A;
[0144] The management address is the IP address used for remote management of switch A.
[0145] 704. Management device obtains neighbor information about switch A;
[0146] Devices in the network exchange neighbor information via the LLDP protocol. If the management device and switch A are neighbors, the management device obtains the neighbor information transmitted by switch A via the LLDP protocol, similar to the process in step 201 where the core switch (management device) obtains the neighbor information transmitted by aggregation switch A. If the management device and switch A are not neighbors, the management device obtains the neighbor information about switch A from its neighboring devices via the COAP protocol, similar to the process in step 201 where the core switch (management device) obtains the neighbor information about access switch A from aggregation switch A. In summary, similar to step 201, the management device obtains local information and neighbor information for all devices in the network.
[0147] 705. The management device sends a management policy to switch A;
[0148] The management policy is used to instruct switch A to report the latest configuration file to the management device when the configuration file on switch A changes.
[0149] 706. Switch A reports the configuration file to the management device;
[0150] Switch A can report configuration files via FTP, SFTP, or HTTP protocols.
[0151] 707. Power on switch A'.
[0152] When switch A fails, the staff will replace switch A with switch A'.
[0153] 708. Management device discovers switch A';
[0154] The management device obtains the device information of switch A' through the COAP protocol, including the MAC address and ESN of switch A'.
[0155] 709. The management device obtains neighbor information about switch A';
[0156] Devices in the network exchange neighbor information via the LLDP protocol. If the management device and switch A' are neighboring devices, the management device obtains the neighbor information transmitted by switch A' via the LLDP protocol, similar to the process in step 203 where the core switch (management device) obtains the neighbor information transmitted by aggregation switch A' (switch A'). If the management device and switch A' are not neighboring devices, the management device obtains the neighbor information about switch A' from the neighboring devices of switch A' via the COAP protocol, similar to the process in step 503 where the core switch (management device) obtains the neighbor information about access switch A' (switch A') on aggregation switch A.
[0157] 710. The management device determined that switch A' replaced switch A;
[0158] Similar to steps 204 and 504 described above, by comparing the neighbor information of switch A' and switch A, the management device discovers that switch A' and switch A are connected to the same interface of the same device, and that the interface status of switch A is down while the interface status of switch A' is up, thus determining that switch A' has replaced switch A.
[0159] 711. The management device sends a configuration file to switch A';
[0160] Optionally, the management device can also obtain software information for both switch A and switch A'. This software information includes the software version number and patch information. The management device determines, based on this information, that switch A' is compatible with switch A's configuration file. For example, if switch A's software version number is greater than or equal to switch A's software version number, then the management device will send the configuration file to switch A'. Alternatively, the management device can display a prompt on the interface, allowing staff to confirm whether a configuration file needs to be sent for automatic configuration. The management device will only send the configuration file after the staff confirms on the interface.
[0161] 712. The management device sends a policy action to switch A';
[0162] After the management device sends the above configuration file to switch A', it further sends policy actions to switch A', such as instructing switch A' to restart and setting it to read the configuration file on the next startup, so that switch A' will automatically take effect after restarting without manual configuration and debugging.
[0163] 713. The management device indicates that the configuration is complete.
[0164] Once the configuration is successfully distributed and switch A' responds with a confirmation message, the management device will display a message indicating that the automatic configuration was successful on the interface.
[0165] The configuration method in this application has been described above. The device in this application is described below:
[0166] Please refer to Figure 8. This application provides a network device 800, including an acquisition unit 801 and a transmission unit 802. The network device 800 is used to implement the operations performed by the core switch in the embodiment shown in Figure 5 above.
[0167] Acquisition unit 801 is used to acquire the configuration file of the second network device;
[0168] The acquisition unit 801 is also used to acquire the first neighbor information of the third network device. The first neighbor information is used to indicate that the second network device is connected to the first interface of the third network device, and the status of the neighbor interface of the first interface is down.
[0169] The acquisition unit 801 is also used to acquire the second neighbor information of the third network device. The second neighbor information is used to indicate that the fourth network device is connected to the first interface of the third network device, and the state of the neighbor interface of the first interface is up.
[0170] The sending unit 802 is used to send a configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
[0171] In one possible implementation,
[0172] The acquisition unit 801 is also used to acquire the first software information of the second network device and the second software information of the fourth network device;
[0173] The sending unit 802 is specifically used to send a configuration file to the fourth network device based on the first neighbor information and the second neighbor information if it is determined that the first software information and the second software information meet the preset conditions.
[0174] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0175] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0176] In one possible implementation,
[0177] The acquisition unit 801 is specifically used to acquire the first neighbor information and the second neighbor information through COAP.
[0178] In one possible implementation,
[0179] The acquisition unit 801 is specifically used to acquire the configuration file of the second network device via FTP, SFTP, or HTTP.
[0180] In one possible implementation,
[0181] The sending unit 802 is also used to send policy actions to the fourth network device so that the fourth network device executes the policy actions and the configuration file takes effect.
[0182] This application provides a network device, including an acquisition unit and a transmission unit, for performing the operations performed by the core switch in the embodiment shown in FIG2 above.
[0183] The acquisition unit is used to acquire the configuration file of the second network device.
[0184] The acquisition unit is also used to acquire first neighbor information, which is used to indicate that the second network device is connected to the first interface of the first network device, and the status of the neighbor interface of the first interface is down.
[0185] The acquisition unit is also used to acquire second neighbor information, which is used to indicate that the third network device is connected to the first interface of the first network device, and the state of the neighbor interface of the first interface is up.
[0186] The sending unit is used to send a configuration file to a third network device based on the first neighbor information and the second neighbor information.
[0187] In one possible implementation,
[0188] The acquisition unit is also used for the first network device to acquire the first software information of the second network device and the second software information of the third network device;
[0189] The sending unit is specifically used to send a configuration file to the third network device based on the first neighbor information and the second neighbor information if it is determined that the first software information and the second software information meet the preset conditions.
[0190] In one possible implementation, the first software information and the second software information include the software version number and patch information.
[0191] In one possible implementation, the preset condition includes that the software version number in the second software information is greater than or equal to the software version number in the first software information.
[0192] In one possible implementation,
[0193] The acquisition unit is specifically used to acquire information about the first neighbor and the second neighbor through LLDP.
[0194] In one possible implementation,
[0195] The acquisition unit is specifically used to obtain the configuration file of the second network device via FTP, SFTP, or HTTP.
[0196] In one possible implementation,
[0197] The sending unit is also used to send policy actions to the third network device so that the third network device can execute the policy actions and make the configuration file effective.
[0198] Figure 9 is a schematic diagram of another network device provided in an embodiment of this application. As shown in Figure 9, the network device may include: a main control board 501 and at least one interface board (the interface board is also called a line card or service board), such as interface board 502 and interface board 503 shown in Figure 9. In the case of multiple interface boards, the network device may also include a switching board 504, which is used to complete data exchange between the interface boards.
[0199] The main control board 501, also known as the main processing unit (MPU) or route processor card, is used for system management, equipment maintenance, and protocol processing. The main control board 501 primarily contains three types of functional units: a system management control unit, a system clock unit, and a system maintenance unit. The main control board 501 includes a central processing unit 5011 and a memory 5012.
[0200] Interface boards 502 and 503, also known as line processing units (LPUs), line cards, or service boards, provide various service interfaces and enable message forwarding. These service interfaces may include: packet over SONET / SDH (POS) interfaces, gigabit Ethernet (GE) interfaces, and asynchronous transfer mode (ATM) interfaces. SONET refers to synchronous optical network, and SDH refers to synchronous digital hierarchy. The main control board 501, interface boards 502 and 503 are interconnected with the system backplane via a system bus. As shown in Figure 9, interface board 502 includes one or more central processing units (CPUs) 5021. CPUs 5021 control and manage interface boards 502 and communicate with CPUs 5011 on the main control board 501. The memory 5024 on the interface board 502 is used to store forwarding table entries. The network processor 5022 can forward packets by looking up the forwarding table entries stored in the memory 5024. The memory 5024 can also be used to store program code.
[0201] The interface board 502 also includes one or more physical interface cards 5023, which are used to receive messages sent by the previous hop node and send processed messages to the next hop node according to the instructions of the central processing unit 5021.
[0202] Furthermore, it is understood that the central processing unit 5021 and / or network processor 5022 in the interface board 502 in Figure 9 can be dedicated hardware or chips, such as ASICs, to implement the above functions. This implementation method is commonly referred to as using dedicated hardware or chips for the forwarding plane. In another embodiment, the central processing unit 5021 and / or network processor 5022 can also use general-purpose processors, such as general-purpose CPUs, to implement the functions described above.
[0203] Furthermore, it should be understood that there may be one or more main control boards 501, and when there are multiple boards, they may include a primary main control board and a backup main control board. There may also be one or more interface boards; the stronger the data processing capability of the network device, the more interface boards it provides. As shown in Figure 9, the network device includes interface boards 502 and 503. When a distributed forwarding mechanism is used, the structure of interface board 503 is basically the same as that of interface board 502, and the operation on interface board 503 is basically similar to that on interface board 502, so it will not be described in detail for simplicity. When the network device has multiple interface boards, these multiple interface boards can communicate with each other through one or more switching network boards 504, and load sharing and redundancy backup can be achieved to provide high-capacity data exchange and processing capabilities.
[0204] In a centralized forwarding architecture, this network device does not require a 504 switching board; the interface board handles the processing of all system service data. Therefore, the data access and processing capabilities of a distributed network device are greater than those of a centralized network device. The specific architecture used depends on the specific network deployment scenario and is not limited here.
[0205] In this embodiment, memory 5012 and memory 5024 can be ROM or other types of static storage devices capable of storing static information and instructions, or RAM or other types of dynamic storage devices capable of storing information and instructions. They can also be EEPROM, compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disks or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but are not limited thereto. Memory 5024 in interface board 502 can exist independently and be connected to central processing unit 5021 via a communication bus; alternatively, memory 5024 can be integrated with central processing unit 5021. Memory 5012 in main control board 501 can exist independently and be connected to central processing unit 5011 via a communication bus; alternatively, memory 5012 can be integrated with central processing unit 5011.
[0206] The program code stored in memory 5024 is executed under the control of central processing unit 5021, and the program code stored in memory 5012 is executed under the control of central processing unit 5011. Central processing unit 5021 and / or central processing unit 5011 can implement the method performed by the network device as described in the above-described method embodiments by executing the program code. The program code stored in memory 5024 and / or memory 5012 may include one or more software units. These one or more software units can be used to implement the operations performed by the core switch in Figure 2 or Figure 5.
[0207] This application also provides a computer program product containing instructions. The computer program product may be a software or program product containing instructions, capable of running on a computing device or stored on any usable medium. When the computer program product is run on at least one computer, it causes the at least one computer to perform the method described in FIG2 or FIG5.
[0208] This application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that instruct a computer to perform the method described in FIG2 or FIG5.
[0209] This application also provides a chip including a processing circuit coupled to a storage circuit. The storage circuit stores instructions, and when the instructions are executed by the processing circuit, the chip performs the method shown in FIG2 or FIG5.
[0210] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.
[0211] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0212] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0213] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A configuration method, characterized in that, include: The first network device obtains the configuration file of the second network device; The first network device obtains the first neighbor information of the third network device. The first neighbor information is used to indicate that the second network device is connected to the first interface of the third network device, and the state of the neighbor interface of the first interface is down. The first network device obtains the second neighbor information of the third network device. The second neighbor information is used to indicate that the fourth network device connects to the first interface of the third network device, and the state of the neighbor interface of the first interface is up. The first network device sends the configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
2. The method according to claim 1, characterized in that, The method further includes: The first network device acquires the first software information of the second network device and the second software information of the fourth network device; The first network device sends the configuration file to the fourth network device based on the first neighbor information and the second neighbor information, including: If the first network device determines that the first software information and the second software information meet preset conditions, it sends the configuration file to the fourth network device based on the first neighbor information and the second neighbor information.
3. The method according to claim 2, characterized in that, The first software information and the second software information include the software version number and patch information.
4. The method according to claim 3, characterized in that, The preset conditions include that the software version number in the second software information is greater than or equal to the software version number in the first software information.
5. The method according to any one of claims 1 to 4, characterized in that, The first network device obtains the first neighbor information and the second neighbor information through the restricted application protocol CoAP.
6. The method according to claim 5, characterized in that, The first network device obtains the configuration file of the second network device, including: The first network device obtains the configuration file of the second network device via File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), or Hypertext Transfer Protocol (HTTP).
7. The method according to claim 6, characterized in that, The method further includes: The first network device sends a policy action to the fourth network device, so that the fourth network device executes the policy action and the configuration file takes effect.
8. A configuration method, characterized in that, include: The first network device obtains the configuration file of the second network device; The first network device obtains first neighbor information, which is used to indicate that the second network device is connected to the first interface of the first network device, and the status of the neighbor interface of the first interface is down; The first network device obtains second neighbor information, which is used to indicate that the third network device connects to the first interface of the first network device, and the state of the neighbor interface of the first interface is up; The first network device sends the configuration file to the third network device based on the first neighbor information and the second neighbor information.
9. The method according to claim 8, characterized in that, The method further includes: The first network device acquires the first software information of the second network device and the second software information of the third network device; The first network device sends the configuration file to the third network device based on the first neighbor information and the second neighbor information, including: If the first network device determines that the first software information and the second software information meet preset conditions, it sends the configuration file to the third network device based on the first neighbor information and the second neighbor information.
10. The method according to claim 9, characterized in that, The first software information and the second software information include the software version number and patch information.
11. The method according to claim 10, characterized in that, The preset conditions include that the software version number in the second software information is greater than or equal to the software version number in the first software information.
12. The method according to claim 11, characterized in that, The first network device obtains the first neighbor information and the second neighbor information through the Link Layer Discovery Protocol (LLDP).
13. The method according to claim 12, characterized in that, The first network device obtains the configuration file of the second network device, including: The first network device obtains the configuration file of the second network device via File Transfer Protocol (FTP), Secure File Transfer Protocol (SFTP), or Hypertext Transfer Protocol (HTTP).
14. The method according to claim 13, characterized in that, The method further includes: The first network device sends a policy action to the third network device, so that the third network device executes the policy action and the configuration file takes effect.
15. A network device, characterized in that, It includes a processor and a memory, the processor being configured to execute instructions stored in the memory to cause the switch to perform the method as described in any one of claims 1 to 14.
16. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a computer, cause the computer to perform the method as claimed in any one of claims 1 to 14.