Reset method, communication apparatus, and storage medium

By recording the write operation information of the forwarding chip in the network device and resetting and rewriting it in case of an anomaly, the problem of abnormal operation of the network device caused by the abnormality of the forwarding chip is solved, and rapid recovery and improved self-healing capability are achieved.

WO2024244714A1PCT designated stage expired Publication Date: 2024-12-05ZTE CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/087427
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-29
Filing Date
2024-04-12
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

When the forwarding chip of a network device malfunctions due to electromagnetic interference or solar flare radiation, it causes abnormal forwarding channel scheduling, affecting the normal operation of the network device. Existing technologies that restore the network by restarting or switching links have a long recovery time, which affects the working efficiency of the network device.

Method used

Record the write operation information of the forwarding chip during the operation of the network device and store it in the target storage space. When the chip is abnormal, perform a reset operation and refresh the forwarding chip according to the pre-stored bitstream information to restore its normal state.

Benefits of technology

It enables rapid recovery of network devices when forwarding chips malfunction, reduces downtime, and improves the self-healing capability and robustness of network devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024087427_05122024_PF_FP_ABST
    Figure CN2024087427_05122024_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a reset method, a communication apparatus, and a storage medium. The reset method comprises: when a forwarding chip of a network device experiences an anomaly, performing a reset operation on the forwarding chip; acquiring prestored operation information from a target storage space, the prestored operation information comprising code stream information from the network device performing a write operation on the forwarding chip, the code stream information comprising a write address and a write value; and according to the prestored operation information, flashing the forwarding chip, so that the forwarding chip returns to a state prior to the reset.
Need to check novelty before this filing date? Find Prior Art

Description

Reset method, communication device, and storage medium

[0001] This disclosure claims priority to Chinese patent application No. 202310621668.7, filed on May 29, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present disclosure relates to the technical field of network equipment, and in particular to a reset method, a communication device, and a storage medium. Background Art

[0003] Electromagnetic interference, solar flare radiation, and other factors can cause network equipment's forwarding chips to experience anomalies. These can include mismatched forwarding chip entries and abnormal forwarding channel scheduling, impacting normal network equipment operation. These anomalies can typically be recovered by restarting or switching links.

[0004] Summary of the Invention

[0005] In one aspect, a reset method is provided. The reset method includes:

[0006] If the forwarding chip of the network device is abnormal, reset the forwarding chip;

[0007] Retrieve pre-stored operation information from the target storage space; wherein the pre-stored operation information includes code stream information of the network device performing a write operation on the forwarding chip; the code stream information includes a write address and a write value;

[0008] The forwarding chip is flashed according to the pre-stored operation information to restore the forwarding chip to the state before the reset.

[0009] In another aspect, a reset device is provided. The reset device comprises:

[0010] A reset module is used to reset the forwarding chip when an abnormality occurs in the forwarding chip of the network device;

[0011] An acquisition module is used to acquire pre-stored operation information from a target storage space; wherein the pre-stored operation information includes code stream information of a network device performing a write operation on a forwarding chip; the code stream information includes a write address and a write value;

[0012] The flashing module is used to flash the forwarding chip according to pre-stored operation information to restore the forwarding chip to a state before reset.

[0013] On the other hand, a communication device is provided, comprising: a memory and a processor; the memory and the processor are coupled; the memory is used to store a computer program; and the processor implements the reset method described in the above aspects when executing the computer program.

[0014] On the other hand, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the reset method described in the above aspect is implemented.

[0015] On the other hand, a computer program product is provided, which includes computer program instructions, and when the computer program instructions are executed by a processor, the reset method described in the above aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] To more clearly illustrate the technical solutions of the present disclosure, the following briefly introduces the drawings required for use in some embodiments of the present disclosure. Obviously, the drawings described below are only drawings of some embodiments of the present disclosure, and those skilled in the art can also derive other drawings based on these drawings.

[0017] FIG1 is a schematic structural diagram of a communication device according to some embodiments of the present disclosure.

[0018] FIG2 is a flowchart of a reset method according to some embodiments of the present disclosure.

[0019] FIG3 is a schematic diagram of a scenario according to some embodiments of the present disclosure.

[0020] FIG4 is a schematic diagram of another scenario according to some embodiments of the present disclosure.

[0021] FIG5 is a flowchart of another reset method according to some embodiments of the present disclosure.

[0022] FIG6 is a schematic structural diagram of a reset device according to some embodiments of the present disclosure. DETAILED DESCRIPTION

[0023] To help those skilled in the art better understand the technical solutions of the embodiments of the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below in conjunction with the drawings in the present disclosure. Obviously, the embodiments described are only some of the embodiments of the present disclosure, not all of them. Based on the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0024] It should be noted that in this disclosure, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this disclosure as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.

[0025] In the following, the terms "first," "second," and the like 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 being referred to. Therefore, a feature defined with the terms "first," "second," and the like may explicitly or implicitly include one or more of such features.

[0026] In the description of this disclosure, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" herein is merely a description of an association relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: only A, only B, and both A and B. Furthermore, "at least one" means one or more, and "a plurality" means two or more.

[0027] Electromagnetic interference, solar flare radiation, and other factors can cause network equipment's forwarding chips to experience anomalies. These can include mismatched forwarding chip entries and abnormal forwarding channel scheduling, impacting normal network equipment operation. These anomalies can usually be recovered by restarting the device.

[0028] Currently, some technologies deal with this problem mainly through the following methods:

[0029] First, the network device uses the check bit or status bit of the forwarding chip to identify whether its forwarding behavior is abnormal. If it is identified that its forwarding behavior is abnormal, if the network device has a backup link, the network device can actively initiate a master-slave switch and switch the forwarding service from the main link to the backup link, thereby avoiding a long-term abnormal state in the network. If the network device does not have a backup protection link, the network device will restart the device after identifying the abnormality.

[0030] However, both switching the protection link and rebooting the device will cause the network device to not function properly for an extended period of time, impacting its efficiency. For the switchover to a backup link, while the backup path will function normally after the switch, the primary link will remain in a forwarding anomaly unless intervention is taken. For the reboot, the table entries must be rewritten after the reboot, and the protocol and forwarding path must be recalculated and issued to ensure the network device's forwarding chip functions properly.

[0031] Table entries are generally rewritten using a software mapping table. However, due to memory size limitations, the software mapping table can generally only cache some important table entries and cannot cache all table entries of the entire chip, especially the numerous registers of the chip, which cannot be handled well.

[0032] In response to the above technical problems, the embodiment of the present disclosure provides a reset method, the idea of ​​which is to replace the software mapping table with a storage operation code stream, and record the code stream information of the write operation of the forwarding chip (for example, the forwarding table and register) involved in the operation of the network device in the target storage space; in this way, when the forwarding chip of the network device is abnormal, the forwarding chip can be restored to normal by a reset operation first, and then the forwarding chip can be flashed according to the pre-stored code stream information to restore the forwarding chip to the state before the reset, so that the network device can quickly restore the forwarding service. It can be seen that based on the method provided by the embodiment of the present disclosure, when the forwarding chip of the network device is abnormal, the network device can be directly reset instead of being completely restarted, and then the forwarding chip can be flashed according to the code stream information to achieve rapid service recovery, which can minimize the forwarding abnormality time caused by the abnormality of the forwarding chip, improve the self-healing ability of the network device, improve the automated maintainability of the network device, and improve the robustness of the network device.

[0033] A communication device provided by an embodiment of the present disclosure is described below with reference to the accompanying drawings.

[0034] Referring to Figure 1 , which is a schematic diagram of the structure of a communication device involved in the reset method provided in an embodiment of the present disclosure, as shown in Figure 1 , the communication device 100 includes: a processor 101 , a forwarding chip 102 , and a memory 103 . Optionally, the communication device 100 may also include: a communication interface 104 and a bus 105 .

[0035] The processor 101 is configured to read instructions and execute them one by one according to an instruction sequence.

[0036] In some embodiments, the processor 101 is configured to issue an operation instruction to the forwarding chip 102. For example, the processor 101 may issue an operation instruction to the forwarding chip 102 to perform a write operation.

[0037] In some embodiments, the processor 101 is further configured to store the code stream information for executing the write operation sent by the processor 101 to the forwarding chip 102 in the memory 103 .

[0038] In some embodiments, when an abnormality occurs in the forwarding chip 102 , the processor 101 is further configured to reset the forwarding chip 102 .

[0039] In some embodiments, the processor 101 is further configured to obtain pre-stored operation information from the memory 103 and flash the forwarding chip 102 according to the operation information. The pre-stored operation information includes code stream information for performing a write operation on the forwarding chip 102.

[0040] Exemplarily, the processor 101 may be a device that implements or executes various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure herein. The processor 101 may also be a central processing unit (CPU), a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array (FPGA), or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processor 101 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processing (DSP) and a microprocessor, and the like.

[0041] The forwarding chip 102 is used to forward electrical signals.

[0042] In some embodiments, when an abnormality occurs in the forwarding chip 102 , the forwarding chip 102 performs a reset operation according to a reset operation instruction issued by the processor 101 .

[0043] After performing the reset operation, the forwarding chip 102 is further configured to receive and execute an operation instruction from the processor 101. For example, the forwarding chip 102 is further configured to receive and execute a write operation instruction from the processor 101.

[0044] The memory 103 is used to store data such as instructions or program codes.

[0045] In some embodiments, the memory 103 may be used to store code stream information when the processor 101 performs a write operation on the forwarding chip 102 .

[0046] Exemplarily, the memory 103 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store dynamic information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0047] In some embodiments, the memory 103 may exist independently of the processor 101 and may be connected to the processor 101 via a bus 105 for storing instructions or program codes. When the processor 101 calls and executes the instructions or program codes stored in the memory 103, the reset method provided in the embodiments of the present disclosure can be implemented.

[0048] In some embodiments, the memory 103 may also be integrated with the processor 101 .

[0049] The communication interface 104 is used to connect to other devices via a communication network, such as Ethernet, wireless access network, or wireless local area network (WLAN).

[0050] Bus 105 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 105 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG1 shows only one thick solid line, but this does not mean that there is only one bus or only one type of bus.

[0051] In some embodiments, the communication device 100 may be a network device, for example, a switch, a router, or an IPRAN based on the Internet Protocol (IP) and the Radio Access Network (RAN).

[0052] A reset method provided by an embodiment of the present disclosure is described below with reference to the accompanying drawings.

[0053] The reset method provided in the present disclosure is applied to a scenario where a forwarding chip of a network device has an abnormality and needs to be reset to quickly restore the forwarding service.

[0054] It should be noted that the execution subject of the reset method provided in the embodiments of the present disclosure is not limited. For example, the method can be executed by the network device itself or by a processor in the network device. For the convenience of subsequent description, the following embodiments are described using the method executed by the processor as an example.

[0055] 2 is a flowchart of a reset method provided by an embodiment of the present disclosure. As shown in FIG2 , the reset method provided by an embodiment of the present disclosure can be implemented as follows S200-S203.

[0056] S200: After the network device is powered on, the code stream information of the network device performing a write operation on the forwarding chip is stored in the target storage space.

[0057] Optionally, the above-mentioned stream information may include stream information generated by the network device writing to the forwarding table of the forwarding chip. The forwarding table, also known as a forwarding database or routing directory, is used to record each forwarding item executed by the forwarding chip. For example, when a network device receives a data frame, it first records the source media access control (MAC) address and destination MAC address in the data frame in the forwarding table.

[0058] It is understandable that the forwarding chip can help data frames flowing through network devices to complete addressing and forwarding by maintaining the forwarding table.

[0059] Optionally, the aforementioned code stream information may include code stream information generated by the network device performing write operations on registers of the forwarding chip. Registers are high-speed storage components with limited storage capacity that can be used to store instructions, data, and addresses. For example, upon receiving a data frame, the network device first records the source MAC address and destination MAC address in the data frame in the register.

[0060] It is understandable that the forwarding chip can help data frames flowing through the network device to complete addressing and forwarding by maintaining registers.

[0061] In some embodiments, the code stream information includes a write address and a write value.

[0062] For example, for code stream information written by a network device to a forwarding chip's forwarding table, the write address is the address of an entry in the forwarding table, and the write value is the field value of the entry. For example, the write address can be in the format of "entry address + index + field," and the write value is the value written to the field.

[0063] Exemplarily, for code stream information in which the network device performs a write operation on a register of a forwarding chip, the write address is the address of the register, and the write value is the value written into the register.

[0064] In some embodiments, the code stream information further includes a timestamp, which is used to indicate the time when the write value is written to the write address.

[0065] Exemplarily, as shown in Figure 3, the operation information of each write operation performed by the network device on the forwarding chip (for example, the code stream information of the network device performing a write operation on the register of the forwarding chip, and the code stream information of the network device performing a write operation on the forwarding table of the forwarding chip) can be stored in the target storage space.

[0066] It should be noted that, in the embodiment of the present disclosure, the delete operation can also be considered as a write operation.

[0067] In some embodiments, the above-mentioned target storage space may include: the internal memory of the network device (for example, the memory of the network device), the external memory of the network device (for example, the hard disk or flash storage device of the network device) or the control device connected to the network device (for example, a software defined network (SDN) controller or network management station, etc.).

[0068] In some embodiments, the above S200 can be implemented as follows: when the first code stream information to be stored has the same write address as the second code stream information stored in the target storage space, and the timestamp of the first code stream information is later than the timestamp of the second code stream information, the second code stream information stored in the target storage space is replaced with the first code stream information.

[0069] For example, for each write address in the register, only one write value is recorded. If the same write address in the register is written multiple times, the last write value is recorded. If a delete operation is performed on the register, the recorded value of the register is cleared.

[0070] For example, for each write address in the forwarding table, only one write value is recorded. If the same write address (same entry address, entry position, and entry field) in the forwarding table is written multiple times, the last write value is recorded. If an entry in the forwarding table is deleted, all recorded values ​​of the entry are cleared.

[0071] It is understood that to address the potential issue of abnormal written values ​​caused by multiple processes operating on the same table entry, when recording the stream information, the storage order of the stream information can be determined based on the timestamp order. If the timestamp of the current stream information in the same position field is later than the timestamp of the stream information recorded in the target storage space, it indicates that the current stream information is updated, and the current stream information is recorded. If the timestamp of the current stream information in the same position field is earlier than the timestamp of the stream information recorded in the target storage space, it indicates that the stream information recorded in the target storage space is updated, and the current stream information is not recorded. In this way, the accuracy of the recorded stream information can be maintained.

[0072] For example, assume that the target storage space has already stored the code stream information of the network device performing a write operation on the register at time 1, which is "time1+register address 1+value 0x1234"; if at time 2, the network device again performs a write operation on register address 1, and the code stream information is "time2+register address 1+value 0x5678"; where time2>time1, the network device replaces the code stream information "time1+register address 1+value 0x1234" stored in the target storage space with "time2+register address 1+value 0x5678".

[0073] In other embodiments, the above S200 can also be implemented as: establishing a mirror table based on the forwarding table and / or register of the forwarding chip of the network device, wherein the mirror table includes the code stream information of the network device performing a write operation on the forwarding chip; and storing the mirror table in the target storage space.

[0074] S201. When a forwarding chip of a network device is abnormal, the forwarding chip is reset.

[0075] In some embodiments, the network device may perform a reset operation on the forwarding chip as follows: the network device issues an operation instruction for the reset operation to the forwarding chip; accordingly, the forwarding chip performs the reset operation after receiving the operation instruction for the reset operation.

[0076] In some embodiments, the network device periodically obtains data on a check bit or status bit of the forwarding chip, and determines whether an abnormality occurs in the forwarding chip based on the data on the check bit or status bit.

[0077] It is understandable that if an abnormality occurs in the forwarding chip, it can be recovered by restarting the network device; in the embodiment of the present disclosure, there is no need to restart the entire network device, only the forwarding chip needs to be reset, and then the forwarding service can be quickly restored through the method provided in the following S202-203, which can effectively improve the self-healing ability of the network device.

[0078] S202. Obtain the pre-stored operation information from the target storage space.

[0079] The pre-stored operation information includes the bitstream information of the write operation performed by the network device on the forwarding chip. For example, the bitstream information stored in the target storage space by the network device during the execution of S201. Exemplarily, the operation information includes: the bitstream information of the write operation performed by the network device on the forwarding table of the forwarding chip; the bitstream information of the write operation performed by the network device on the register of the forwarding chip.

[0080] S203. Rewrite the forwarding chip according to the pre-stored operation information, so that the forwarding chip is restored to the state before reset.

[0081] Exemplarily, as shown in Figure 4, the processor of the network device obtains the pre-stored operation information from the target storage space (for example, the bitstream information of the write operation performed by the network device on the register of the forwarding chip, and the bitstream information of the write operation performed by the network device on the forwarding table of the forwarding chip), and then, according to the pre-stored operation information, rewrites the forwarding chip to restore the forwarding chip to the state before reset.

[0082] In some embodiments, the above S203 can be implemented as: rewrite the bitstream information stored in the target storage space to the forwarding chip according to the order of the timestamps of each bitstream information stored in the target storage space.

[0083] Exemplarily, assuming that the bitstream information stored in the target storage space includes: time2 + register address 2 + value 0x5678; time3 + register address 1 + value 0x2234; time4 + entry address 1 + index1 + field A + value 0x1234; where time2 < time3 < time4, then according to the order of the timestamps, first rewrite the bitstream information "time2 + register address 2 + value 0x5678" to register 2; then rewrite the bitstream information "time3 + register address 1 + value 0x2234" to register 1; finally rewrite the bitstream information "time4 + entry address 1 + index1 + field A + value 0x1234" to the entry address 1 of the forwarding table.

[0084] It can be understood that the method provided by the embodiment of the present disclosure replaces the software mapping table with a storage operation code stream, and records the code stream information of the write operation of the forwarding chip (for example, the forwarding table and register) involved in the operation of the network device in the target storage space; in this way, when the forwarding chip of the network device is abnormal, the forwarding chip can be restored to normal by a reset operation, and then the forwarding chip is flashed according to the pre-stored code stream information to restore the forwarding chip to the state before the reset, thereby allowing the network device to quickly restore the forwarding service. It can be seen that based on the method provided by the embodiment of the present disclosure, when the forwarding chip of the network device is abnormal, the network device can be directly reset instead of being completely restarted, and then the forwarding chip is flashed according to the code stream information to achieve rapid service recovery (the forwarding service of the network device can be restored in seconds or milliseconds), which can minimize the forwarding abnormality time caused by the abnormality of the forwarding chip, improve the self-healing ability of the network device, improve the automated maintainability of the network device, and improve the robustness of the network device.

[0085] Optionally, as shown in FIG5 , after the above S203 , the above method further includes the following S204 .

[0086] S204 , re-send the information to be written to the forwarding chip through the protocol, so that the forwarding chip compares the information to be written with the information already written on the forwarding chip, and updates the information already written on the forwarding chip according to the comparison result.

[0087] The information to be written may include: information to be written to a register and information to be written to a forwarding table.

[0088] Exemplarily, the above S204 can be implemented as the following a1-a3.

[0089] a1. The processor of the network device resends the information to be written to the forwarding chip through the protocol.

[0090] a2. The forwarding chip receives the information to be written and compares the information to be written with the information already written on the forwarding chip.

[0091] Exemplarily, the above step a2 may be implemented as follows: comparing the information to be written in the register with the information already written in the register; and comparing the information to be written in the forwarding table with the information already written in the forwarding table.

[0092] a3. The forwarding chip updates the written information on the forwarding chip according to the comparison result.

[0093] Exemplarily, the above a3 can be implemented as follows: if the information to be written in the register is the same as the information already written in the register (that is, the information to be written in the register has been written in the register), then the write operation will no longer be performed on the register; if the information to be written in the forwarding table is the same as the information already written in the forwarding table (that is, the information to be written in the forwarding table has been written in the forwarding table), then the write operation will no longer be performed on the forwarding table.

[0094] If the information to be written in the register is different from the information already written in the register, the information to be written in the register is written into the register; if the information to be written in the forwarding table is different from the information already written in the forwarding table, the information to be written in the forwarding table is written into the forwarding table.

[0095] It is understood that after the flash operation in S203, the forwarding chip has been restored to its pre-chip reset state, and the network device's software protocols, etc., begin to rebuild. After the protocol is rebuilt, the protocol can be used to re-download entry information and register information to the forwarding chip. This information can be compared with the information currently written to the chip to verify the flash operation of the forwarding chip and ensure that the subsequent chip data is correct.

[0096] For ease of understanding, the reset method provided in the embodiment of the present disclosure is described below in the form of an example.

[0097] For example, assuming that the network device needs to operate on register 1, register 2, index 1 of entry 1, and index 2 of entry 2 of the chip, the operation can be implemented as follows.

[0098] Operation 1: The network device records the code stream information of the processor performing the write operation on the forwarding chip.

[0099] Exemplarily, the code stream information recorded by the network device may include:

[0100] 1. The network device performs a write operation to register 1 at time 1, writing the value 0x1234; the corresponding code stream information is "time 1 + register address 1 + value 0x1234", and the code stream information is stored in the target storage space.

[0101] 2. The network device performs a write operation to register 2 at time 2, writing the value 0x5678; the corresponding code stream information is "time 2 + register address 2 + value 0x5678", and the code stream information is stored in the target storage space.

[0102] 3. The network device writes to register 1 again at time 3, writing the value 0x2234. The corresponding code stream information is "time 3 + register address 1 + value 0x2234". Since the target storage space already has the code stream information of register address 1, and time 3 is later than time 1, the code stream information "time 1 + register address 1 + value 0x1234" stored in the target storage space is replaced with "time 3 + register address 1 + value 0x2234".

[0103] 4. The network device performs a write operation to register 1 again at time 2.5, writing the value 0x3234. The corresponding code stream information is "time 2.5 + register address 1 + value 0x3234". Since the code stream information of register address 1 has already been recorded in the target storage space, and time 2.5 is earlier than the currently recorded time 3, this operation is considered to be the previous register operation and is not recorded in the target storage space.

[0104] 5. At time 4, the network device writes the value 0x1234 to entry 1, index 1, field A in the forwarding table. Entry address 1 + index 1 + field A can be considered an index similar to a register address. This stream is recorded as "time 4 + entry address 1 + index 1 + field A + value 0x1234." All subsequent operations are similar to register operations. If the target storage space already has stream information with the same "entry address + index + field" stored in it, the time is compared to determine whether to update the record based on the time information.

[0105] Operation 2: The network device resets the forwarding chip and then flashes the forwarding chip after the reset to restore the forwarding chip to its pre-reset state.

[0106] Exemplarily, the above operation 2 can be implemented as follows:

[0107] 1. The network device resets the forwarding chip to perform basic initialization.

[0108] 2. After the forwarding chip is initialized, the network device obtains operation information from the target storage space.

[0109] Exemplarily, the operation information obtained by the network device from the target storage space may include: "time2+register address 2+value 0x5678", "time3+register address 1+value 0x2234", and "time4+table entry address 1+index1+field A+value 0x1234".

[0110] 3. The network device writes the operation information to register 2, register 1, and table address 1 in sequence according to the timestamp order.

[0111] For example, the network device first writes the code stream information "time2+register address 2+value 0x5678" to register 2 according to the order of timestamp time; then writes the code stream information "time3+register address 1+value 0x2234" to register 1; and finally writes the code stream information "time4+table entry address 1+index1+field A+value 0x1234" to the table entry address 1 of the forwarding table.

[0112] Optionally, after the above operation 2, the following operation 3 may be further included:

[0113] Operation 3: The network device verifies the information written in the forwarding chip according to the protocol.

[0114] 1. The processor of the network device re-sends the information to be written to the register and the information to be written to the forwarding table to the forwarding chip through the protocol.

[0115] 2. The forwarding chip compares the information to be written in the register with the information already written in the register, and compares the information to be written in the forwarding table with the information already written in the forwarding table.

[0116] 3. If the information to be written is consistent with the information already written, no further write operation is performed on the forwarding chip; if the information to be written is inconsistent with the information already written, the information to be written is written into the forwarding chip.

[0117] The above process completes the process of recording the bitstream information of the forwarding chip based on the timestamp of the network device processor, and resetting the forwarding chip and rewriting the bitstream information when an abnormality occurs in the forwarding chip. Based on the reset method provided by the embodiment of the present disclosure, the forwarding service of the network device can be quickly restored, which can effectively improve the self-healing ability of the network device, enhance the device's automated maintainability, and enhance the robustness of the network device.

[0118] The above mainly introduces the solution of the embodiment of the present disclosure from the perspective of method. It can be understood that in order to realize the above functions, the reset device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easy for those skilled in the art to realize that, in combination with the units and algorithm steps of each example described in the embodiment disclosed herein, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiment of the present disclosure.

[0119] The embodiment of the present disclosure can divide the reset device into functional modules according to the above-mentioned method embodiment. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one functional module. The above-mentioned integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present disclosure is schematic and is only a logical function division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

[0120] Figure 6 is a schematic diagram of the structure of a reset device provided in an embodiment of the present disclosure. The reset device can execute the reset method provided in the above method embodiment. As shown in Figure 6, the reset device 300 includes: a reset module 301, an acquisition module 302, and a flash module 303. In other embodiments, the reset device 300 may also include a storage module 304.

[0121] The reset module 301 is configured to reset the forwarding chip when an abnormality occurs in the forwarding chip of the network device.

[0122] The acquisition module 302 is used to acquire pre-stored operation information from the target storage space; wherein the pre-stored operation information includes code stream information of the network device performing a write operation on the forwarding chip; the code stream information includes a write address and a write value.

[0123] The flashing module 303 is used to flash the forwarding chip according to pre-stored operation information to restore the forwarding chip to a state before reset.

[0124] In some embodiments, the above-mentioned code stream information includes at least one of the following: code stream information when the network device performs a write operation on the forwarding table of the forwarding chip; code stream information when the network device performs a write operation on the register of the forwarding chip.

[0125] In some embodiments, for the code stream information in which the network device performs a write operation on the forwarding table of the forwarding chip, the write address is the table entry address of the forwarding table, and the write value is the field value of the write table entry; for the code stream information in which the network device performs a write operation on the register of the forwarding chip, the write address is the address of the register, and the write value is the value of the write register.

[0126] In some embodiments, the code stream information further includes: a timestamp; the timestamp is used to indicate the time when the write value is written to the write address.

[0127] In some embodiments, the storage module 504 is configured to store the code stream information of the network device performing a write operation on the forwarding chip in the target storage space after the network device is powered on.

[0128] In some embodiments, the storage module 504 is configured to replace the second code stream information stored in the target storage space with the first code stream information if the first code stream information to be stored has the same write address as the second code stream information stored in the target storage space and the timestamp of the first code stream information is later than the timestamp of the second code stream information.

[0129] In some embodiments, the above-mentioned flash module 303 is also used to re-send the information to be written to the forwarding chip through the protocol, so that the forwarding chip compares the information to be written with the information already written on the forwarding chip, and updates the information already written on the forwarding chip according to the comparison result.

[0130] In some embodiments, the target storage space includes: an internal memory of the network device, an external memory of the network device, or a control device connected to the network device.

[0131] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the reset method described in any of the above embodiments.

[0132] For example, the computer-readable storage media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in the present disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0133] An embodiment of the present disclosure provides a computer program product comprising instructions. When the computer program product is run on a computer, the computer is enabled to execute the reset method described in any one of the above embodiments.

[0134] The above is only a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed in the present disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A reset method, applied to a network device; in, The method comprises: When an abnormality occurs in the forwarding chip of the network device, resetting the forwarding chip; Acquire pre-stored operation information from the target storage space; wherein the pre-stored operation information includes code stream information of the network device performing a write operation on the forwarding chip; the code stream information includes a write address and a write value; The forwarding chip is flashed according to the pre-stored operation information to restore the forwarding chip to a state before the reset.

2. The method according to claim 1, in, The code stream information includes at least one of the following: The code stream information of the network device performing a write operation on the forwarding table of the forwarding chip; The network device performs code stream information of a write operation on a register of the forwarding chip.

3. The method according to claim 2, in, For the code stream information for which the network device performs a write operation on the forwarding table of the forwarding chip, the write address is the table entry address of the forwarding table, and the write value is the field value written into the table entry; For the code stream information in which the network device performs a write operation on the register of the forwarding chip, the write address is the address of the register, and the write value is the value written into the register.

4. The method according to claim 1, in, The code stream information also includes: a timestamp; the timestamp is used to indicate the time when the write value is written at the write address.

5. The method according to claim 4, in, When an abnormality occurs in the forwarding chip of the network device, before resetting the forwarding chip, the method further includes: After the network device is powered on, the code stream information of the network device performing a write operation on the forwarding chip is stored in the target storage space.

6. The method according to claim 5, in, The method further comprises: storing the code stream information of the network device performing a write operation on the forwarding chip in the target storage space, comprising: When the write address of the first code stream information to be stored is the same as the write address of the second code stream information stored in the target storage space, and the timestamp of the first code stream information is later than the timestamp of the second code stream information, the second code stream information stored in the target storage space is replaced by the first code stream information.

7. The method according to claim 1, in, After the forwarding chip is flashed according to the pre-stored operation information, the method further includes: The information to be written is re-sent to the forwarding chip through the protocol, so that the forwarding chip compares the information to be written with the information already written on the forwarding chip, and updates the information already written on the forwarding chip according to the comparison result.

8. The method according to claim 1, in, The target storage space includes: an internal memory of the network device, an external memory of the network device, or a control device connected to the network device.

9. A communication device, include: a processor and a memory for storing instructions executable by the processor; The processor is configured to execute the instruction so that the communication device performs the reset method according to any one of claims 1 to 8.

10. A computer-readable storage medium, in, The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on an electronic device, the electronic device executes the reset method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Optical line terminal, and method for upgrading master device and slave device

    CN108027723A

  • Soft reset method and system for Ethernet switch

    CN113010349A

  • Switch starting method and device, electronic equipment and storage medium

    CN113282351A

  • Method, service board, and system for transmitting KVM data

    US20120297098A1