Flow control method, main control board, line card board, electronic equipment and medium

By identifying and processing packet loss protocol messages in the main control board of distributed devices, the rate at which the target line card board sends specific protocol types messages to the main control board is reduced, and packet loss problems caused by burst packets in the packet receiving channel in distributed devices are solved, and transmission performance is improved.

CN119892748AActive Publication Date: 2025-04-25NEW H3C TECH CO LTD

Patent Information

Application Number
CN202510059478.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-14
Publication Date
2025-04-25
Estimated Expiration
2045-01-14

AI Technical Summary

Technical Problem

In distributed devices, the same packet receiving channel of the main control board may receive a large number of burst messages in a short time, resulting in an increase in the probability of packet loss of protocol messages.

Method used

By determining the protocol packets that lost packets occurred in the previous detection period in the main control board, and determining the largest number of target protocol messages based on the source line card board identifier and protocol type identification carried, a notification is sent to the forwarding chip of the target line card board, instructing it to reduce the rate of sending the protocol packets of the target protocol type to the main control board.

Benefits of technology

It effectively reduces the probability of packet loss of protocol packets on the same packet receiving channel of the main control board, improves the transmission performance of distributed devices, and avoids the impact on other line card boards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119892748A_ABST
    Figure CN119892748A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a flow control method, a main control board, a line card board, electronic equipment and a medium, and relates to the technical field of communication, the method is applied to a processor in the main control board of distributed equipment, and the method comprises the following steps: determining a first protocol message with packet loss in a previous detection period; determining the most target protocol messages in the first protocol messages carrying the same source line card board identifier and protocol type identifier, and sending a first notification carrying the identifier of the target protocol type to a forwarding chip of a target line card board, the forwarding chip is indicated to reduce the rate of sending the protocol message of the target protocol type to a processor in the main control board. By applying the scheme provided by the embodiment of the invention, the probability of packet loss of the protocol message on the packet receiving channel caused by a large number of burst messages on the same packet receiving channel of the main control board can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a flow control method, a main control board, a line card board, an electronic device and a medium. Background Art

[0002] Distributed devices generally include a master control board (Master, Mr) and multiple line cards (Line Cards, LCs). Mr includes a processor (Central Processing Unit, CPU), and LC includes a forwarding chip and CPU. The CPU can be divided into a CPU driver and a CPU platform. When a protocol message is processed by a distributed device, it first enters the LC through the user port of the LC. The forwarding chip of the LC will identify the type of the protocol message. Based on the type of the protocol message, different types of protocol messages are added to different protocol channels, and the protocol messages are sent to the CPU driver of the LC according to different protocol channels. After the CPU driver of the LC processes the protocol message, it sends the processed protocol message to the CPU platform of the LC through different protocol channels. After receiving the protocol message, the CPU platform of the LC will send the protocol message to Mr so that the CPU of Mr can process the protocol message.

[0003] When the CPU platform of LC sends protocol messages to Mr, it will also distinguish different packet sending channels according to different protocol types, and Mr will also distinguish different packet receiving channels accordingly. However, the way the CPU platform distinguishes packet sending channels is based on the network layer protocol, and the way the CPU driver distinguishes protocol channels is based on non-network layer protocols. The two ways of distinguishing channels are different. In this way, after the protocol messages of different protocol channels driven by the CPU reach the CPU platform, the CPU platform will send the protocol messages of the same network layer protocol among these different types of protocol messages to Mr through the same packet sending channel. When the CPU platforms of multiple LCs send different types of protocol messages to Mr at the same time, it may cause a large number of burst messages on the same packet receiving channel on Mr in a short period of time, resulting in the loss of protocol messages on the packet receiving channel. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a flow control method, a main control board, a line card board, an electronic device and a medium to reduce the probability of protocol message loss on the same packet receiving channel of the main control board when there are a large number of burst messages on the same packet receiving channel. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a flow control method, which is applied to a processor in a main control board of a distributed device, and the method includes:

[0006] Determine a first protocol message in which packet loss occurs in the last detection cycle; wherein the first protocol message is sent by a forwarding chip in a line card board in the distributed device to a processor in the main control board;

[0007] Determine the target protocol message with the largest number in the first protocol message carrying the same source line card board identifier and protocol type identifier, wherein the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message;

[0008] A first notification carrying an identifier of a target protocol type is sent to a forwarding chip of a target line card board to instruct the forwarding chip to reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board, wherein the target line card board is the line card board corresponding to the source line card board identifier carried by the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried by the target protocol message.

[0009] In one embodiment of the present application, after sending a first notification carrying an identifier of a target protocol type to a forwarding chip of a target line card board to instruct the forwarding chip to reduce a rate at which protocol packets of the target protocol type are sent to a processor in the main control board, the method further includes:

[0010] Monitoring a first number of target protocol packets that are lost within a detection period after sending the first notification;

[0011] If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0012] In one embodiment of the present application, the determining of the target protocol message with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier includes:

[0013] Recording the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier;

[0014] According to the corresponding relationship, the target protocol messages with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier are determined.

[0015] In a second aspect, an embodiment of the present application provides a flow control method, which is applied to a forwarding chip in any line card board of a distributed device, and the method includes:

[0016] Sending a protocol message to a processor in a main control board of the distributed device, wherein the protocol message carries an active line card board identifier and a protocol type identifier, wherein the source line card board identifier indicates a line card board that sends the protocol message, and the protocol type identifier indicates a non-network layer protocol type corresponding to the protocol message;

[0017] If a first notification carrying an identifier of a target protocol type is received from the processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained;

[0018] Among them, the target protocol type is: the processor in the main control board determines that the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

[0019] In one embodiment of the present application, reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board includes:

[0020] If the target protocol type is a specified protocol type, maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board; the specified protocol type is: a protocol type whose sending rate is less than a preset rate threshold;

[0021] If the target protocol type is a non-specified protocol type, the rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced.

[0022] In one embodiment of the present application, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the method further includes:

[0023] If a second notification carrying an identifier of the target protocol type is received, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored, wherein the second notification is: the processor in the main control board monitors a first number of target protocol messages that are lost within a detection period after sending the first notification, and sends the message to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

[0024] In one embodiment of the present application, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the method further includes:

[0025] Monitoring a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification;

[0026] If a second notification carrying an identifier of the target protocol type is received, a third number of protocol messages of the target protocol type that have been lost within a third preset number of cycles after receiving the second notification is monitored, wherein the second notification is a first number of target protocol messages that have been lost within a detection cycle after the processor in the main control board monitors and sends the first notification, and is sent to the forwarding chip when the first number monitored within a first preset number of detection cycles is less than a preset number threshold;

[0027] If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.

[0028] In a third aspect, an embodiment of the present application provides a main control board, the main control board is located in a distributed device, and a processor in the main control board is used to perform the following steps:

[0029] Determine a first protocol message in which packet loss occurs in the last detection cycle; wherein the first protocol message is sent by a forwarding chip in a line card board in the distributed device to a processor in the main control board;

[0030] Determine the target protocol message with the largest number in the first protocol message carrying the same source line card board identifier and protocol type identifier, wherein the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message;

[0031] A first notification carrying an identifier of a target protocol type is sent to a forwarding chip of a target line card board to instruct the forwarding chip to reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board, wherein the target line card board is the line card board corresponding to the source line card board identifier carried by the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried by the target protocol message.

[0032] In one embodiment of the present application, after sending a first notification carrying an identifier of a target protocol type to a forwarding chip of a target line card board to instruct the forwarding chip to reduce a rate at which protocol packets of the target protocol type are sent to a processor in the main control board, the processor in the main control board is further configured to perform the following steps:

[0033] Monitoring a first number of target protocol packets that are lost within a detection period after sending the first notification;

[0034] If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0035] In one embodiment of the present application, the processor in the main control board is specifically used to perform the following steps:

[0036] Recording the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier;

[0037] According to the corresponding relationship, the target protocol messages with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier are determined.

[0038] In a fourth aspect, an embodiment of the present application provides a line card board, wherein the line card board is any line card board in a distributed device, and a forwarding chip in the line card board performs the following steps:

[0039] Sending a protocol message to a processor in a main control board of the distributed device, wherein the protocol message carries an active line card board identifier and a protocol type identifier, wherein the source line card board identifier indicates a line card board that sends the protocol message, and the protocol type identifier indicates a non-network layer protocol type corresponding to the protocol message;

[0040] If a first notification carrying an identifier of a target protocol type is received from the processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained;

[0041] Among them, the target protocol type is: the processor in the main control board determines that the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

[0042] In one embodiment of the present application, the forwarding chip in the line card board is specifically used to perform the following steps:

[0043] If the target protocol type is a specified protocol type, maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board; the specified protocol type is: a protocol type whose sending rate is less than a preset rate threshold;

[0044] If the target protocol type is a non-specified protocol type, the rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced.

[0045] In one embodiment of the present application, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps:

[0046] If a second notification carrying an identifier of the target protocol type is received, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored, wherein the second notification is: the processor in the main control board monitors a first number of target protocol messages that are lost within a detection period after sending the first notification, and sends the message to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

[0047] In one embodiment of the present application, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps:

[0048] Monitoring a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification;

[0049] If a second notification carrying an identifier of the target protocol type is received, a third number of protocol messages of the target protocol type that have been lost within a third preset number of cycles after receiving the second notification is monitored, wherein the second notification is a first number of target protocol messages that have been lost within a detection cycle after the processor in the main control board monitors and sends the first notification, and is sent to the forwarding chip when the first number monitored within a first preset number of detection cycles is less than a preset number threshold;

[0050] If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.

[0051] An embodiment of the present application further provides an electronic device, comprising a main control board and at least one line card board, wherein the main control board is any of the main control boards described above, and the line card board is any of the line card boards described above.

[0052] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor in a main control board, any of the above-mentioned flow control methods for a processor in a main control board of a distributed device is implemented.

[0053] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a forwarding chip in a line card board, any of the above-mentioned flow control methods for a forwarding chip in a line card board applied to a distributed device is implemented.

[0054] An embodiment of the present application also provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the above-mentioned flow control methods.

[0055] Beneficial effects of the embodiments of the present application:

[0056] In the technical solution provided in the embodiment of the present application, the main control board of the distributed device determines the first protocol message in which packet loss occurs in the previous detection cycle, and determines the target protocol message with the largest number among the first protocol messages carrying the same source line card board identifier and protocol type identifier. That is, the main control board can determine the protocol message (target protocol message) with the largest number of packet loss in the previous detection cycle and having the same source line card board identifier and protocol type identifier. Since the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message, the main control board can determine the target line card board that sends the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card board identifier and the protocol type identifier carried by the target protocol message, and then the main control board sends a first notification to the forwarding chip of the target line card board to instruct the above-mentioned forwarding chip to reduce the rate at which protocol messages of the target protocol type are sent to the main control board. It can be seen that the technical solution provided by the embodiment of the present application is that the main control board senses the protocol message with the largest number of packet losses in the previous detection cycle and the same source line card board identifier and protocol type identifier, and then determines the target line card board and the target protocol type based on the source line card board identifier and the protocol type identifier of the protocol message, thereby instructing the forwarding chip of the target line card board to reduce the sending rate of the protocol message of the target protocol type, that is, to achieve flow control on the sending end, thereby reducing the probability of protocol message loss on the same packet receiving channel of the main control board due to the presence of a large number of burst messages on the packet receiving channel.

[0057] In addition, in the technical solution provided in the embodiment of the present application, the main control board instructs the forwarding chip of the target line card board to reduce the rate of sending protocol messages of the target protocol type to the main control board, that is, the impact of the burst of protocol messages of the target protocol type on other protocol messages on the same packet receiving channel on the main control board is reduced. Compared with the method in which the main control board notifies all line card boards of the distributed device to reduce the rate of sending protocol messages of all protocol types to the main control board to reduce the probability of packet loss, the present solution only reduces the sending rate of protocol messages of the target protocol type by the target line card board, and therefore will not affect the sending of protocol messages of other protocol types by other line card boards, nor will it affect the sending of protocol messages of other protocol types by the target line card board, thereby improving the transmission performance between the main control board and the line card board of the distributed device.

[0058] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0060] Figure 1 A schematic diagram of the structure of a distributed device provided in an embodiment of the present application;

[0061] Figure 2 A schematic diagram of a flow chart of a first flow control method provided in an embodiment of the present application;

[0062] Figure 3 A flow chart of a second flow control method provided in an embodiment of the present application;

[0063] Figure 4 A schematic diagram of a flow chart of a third flow control method provided in an embodiment of the present application;

[0064] Figure 5 A schematic diagram of a fourth flow control method provided in an embodiment of the present application;

[0065] Figure 6 A schematic diagram of a fifth flow control method provided in an embodiment of the present application;

[0066] Figure 7 A schematic diagram of the structure of a main control board provided in an embodiment of the present application;

[0067] Figure 8 A schematic diagram of the structure of a line card provided in an embodiment of the present application;

[0068] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0069] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0070] See also Figure 1 , is a schematic diagram of the structure of a distributed device provided in an embodiment of the present application, Figure 1 The distributed device shown in the figure includes one main control board 101 and two line card boards 102, which is not limiting. The main control board 101 includes a CPU, and the line card board 102 includes a forwarding chip and a CPU, which can be divided into a CPU driver and a CPU platform.

[0071] Combine the following Figure 1 , describes the process of a line card board of a distributed device sending a protocol message to a main control board of the distributed device.

[0072] When the protocol message is processed by the distributed device, it first enters the line card board 102 through the user port of the line card board 102. The forwarding chip of the line card board 102 will identify the non-network layer protocol type of the protocol message, such as Remote Procedure Call (RPC), Link Protocol (LP), Directory System Protocol (DSP) and Open Shortest Path First (OSPF). Based on the non-network layer protocol type of the protocol message, different types of protocol messages are added to different protocol channels, and the protocol messages are sent to the CPU driver of the line card board 102 according to different protocol channels. Here, each non-network layer protocol type corresponds to at least one protocol channel. For example, the forwarding chip writes the protocol message of the RPC protocol type to protocol channel 1 and protocol channel 2, writes the protocol message of the LP protocol type to protocol channel 3, writes the protocol message of the DSP protocol type to protocol channel 4, and writes the protocol message of the OSPF protocol type to protocol channel 5.

[0073] After receiving the protocol message sent by the forwarding chip, the CPU driver of the line card board 102 processes the protocol message and sends the processed protocol message to the CPU platform of the line card board 102 via different protocol channels.

[0074] After the CPU platform of the line card board 102 receives the protocol message sent by the CPU, it distinguishes the packet sending channels according to different network layer protocol types, adds different types of protocol messages to different packet sending channels based on the network layer protocol type of the protocol message, and sends the protocol message to the CPU of the main control board 101 according to different packet sending channels, so that the CPU of the main control board 101 processes the protocol message. Correspondingly, the CPU of the main control board 101 will also distinguish the packet receiving channels according to different network layer protocol types, that is, the above-mentioned packet sending channels and packet receiving channels are corresponding. Here, the network layer protocol type can specifically be Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), and Multi-Protocol Label Switching (MPLS). Each network layer protocol corresponds to at least one packet receiving channel. For example, the CPU platform writes protocol packets of the IPv4 protocol type into packet sending channel 1 and packet sending channel 2, writes protocol packets of the IPv6 protocol type into packet sending channel 3, and writes protocol packets of the MPLS protocol type into packet sending channel 4.

[0075] Since the CPU platform distinguishes the packet transmission channels based on the network layer protocol, and the CPU driver distinguishes the protocol channels based on the non-network layer protocol, the two distinguish channels in different ways. This will cause the CPU platform to send the protocol messages belonging to the same network layer protocol among these different types of protocol messages to the CPU of the main control board 101 through the same packet transmission channel after the protocol messages through different protocol channels driven by the CPU arrive at the CPU platform. For example, after the protocol messages in protocol channel 1 and protocol channels 3-5 arrive at the CPU platform, they will be sent to the CPU of the main control board 101 through packet transmission channel 1, and after the protocol messages in protocol channel 2 arrive at the CPU platform, they will be sent to the CPU of the main control board 101 through packet transmission channel 2.

[0076] When the CPU platforms of the two line cards 102 simultaneously send different types of protocol messages to the CPU of the main control board 101, a large number of burst messages may exist on the same packet receiving channel on the CPU of the main control board 101 within a short period of time, resulting in packet loss of protocol messages on the packet receiving channel.

[0077] In order to solve the above problems, the embodiments of the present application provide a flow control method, a main control board, a line card board, and a device.

[0078] See also Figure 2, is a flow chart of the first flow control method provided in the embodiment of the present application, which is applied to the CPU in the main control board of the distributed device. For the convenience of description, the execution subject is referred to as the main control board CPU below. The above method includes the following steps S201-S203. Specifically, the above distributed device can be a distributed router.

[0079] S201, determining a first protocol message that has been lost in a previous detection cycle.

[0080] The first protocol message is sent from the forwarding chip in the line card board in the distributed device to the main control board.

[0081] Specifically, the messages received by the distributed device can be divided into protocol messages at the control layer and data messages at the data layer. After any line card of the distributed device receives the message, the forwarding chip of the line card performs type analysis on the message to determine whether the message is a protocol message or a data message. When it is determined that the message is a protocol message, the protocol message will be sent to the main control board CPU of the distributed device, and the main control board CPU will process the protocol message. The specific process of the forwarding chip in the line card sending the protocol message to the main control board CPU can be seen in the above description.

[0082] The CPU of the main control board receives the protocol message sent by the line card board, and the processing flow of the protocol message is to process it in a queue. Specifically, after the CPU of the main control board receives the protocol message sent by the line card board, it writes the protocol message to the corresponding packet receiving channel. If it exceeds the processing capacity of the CPU of the main control board, it will appear as congestion of the packet receiving channel, and the newly received protocol message will fail to be written into the packet receiving channel. The protocol message on the packet receiving channel will be lost, and the protocol messages that are lost are collectively referred to as first protocol messages. Since multiple line card boards of distributed devices will send protocol messages to the main control board, the first protocol message that is lost may be sent from only one line card board in the distributed device to the CPU chip of the main control board, or it may be sent from multiple line card boards in the distributed device to the CPU chip of the main control board.

[0083] The specific value of the detection period can be set based on demand, such as setting the detection period to 1 hour, or setting the detection period to 30 minutes, etc. The solution provided in the embodiment of the present application does not limit the specific duration of the detection period.

[0084] In an embodiment of the present application, the main control board CPU can periodically monitor multiple packet receiving channels on the main control board CPU. If packet loss is detected on a certain packet receiving channel, the message information of the lost first protocol message is recorded, and then the first protocol message that was lost on the packet receiving channel in the previous detection cycle at the moment when the packet loss occurred is determined.

[0085] S202: Determine the largest number of target protocol messages among the first protocol messages carrying the same source line card identifier and protocol type identifier.

[0086] The source line card board identifier carried in the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried in the protocol message indicates the non-network layer protocol type corresponding to the protocol message. The non-network layer protocol type can be RPC protocol, LP protocol, DSP protocol and OSPF protocol.

[0087] Specifically, when the forwarding chip of the line card board of the distributed device sends a protocol message to the main control board CPU, the active line card board identifier and the protocol type identifier will be carried in the protocol message, thereby providing a basis for the main control board CPU to specifically notify the forwarding chip of the target line card board to instruct the forwarding chip to specifically reduce the rate of sending protocol messages of the target protocol type to the main control board CPU.

[0088] In an embodiment of the present application, after the main control board CPU determines that the first protocol message that has been lost in the previous detection cycle, it can perform statistical counting on the first protocol messages for all the first protocol messages in the previous detection cycle according to the source line card board identifier and the protocol type identifier carried by the first protocol message, and then determine the target protocol message with the largest number among the first protocol messages carrying the same source line card board identifier and protocol type identifier.

[0089] In one embodiment of the present application, the main control board CPU can determine the largest number of target protocol messages among the first protocol messages carrying the same source line card board identifier and protocol type identifier based on step A-step B.

[0090] Step A: recording the corresponding relationship between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier.

[0091] The main control board CPU can count the first protocol messages carrying the same source line card board identifier and protocol type identifier according to the source line card board identifier and protocol type identifier carried by the first protocol message, and then record the corresponding relationship between the source line card board identifier and protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and protocol type identifier. The above correspondence relationship can be represented and stored in the form of a table, or in other forms. The embodiment of the present application does not specifically limit the form of the above correspondence relationship.

[0092] Step B: determining the largest number of target protocol messages among the first protocol messages carrying the same source line card identifier and protocol type identifier according to the corresponding relationship.

[0093] The following takes the corresponding relationship in a table form as an example to briefly describe the process of determining the target protocol message with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier.

[0094] Specifically, refer to Table 1, which is a schematic diagram of the correspondence between the source line card board identifier and protocol type identifier recorded and the number of first protocol messages carrying the same source line card board identifier and protocol type identifier after the first protocol message is statistically counted according to the same source line card board identifier and protocol type identifier carried by the first protocol message in the previous detection cycle.

[0095] Table 1

[0096] It can be seen from Table 1 above that the source line card board is identified as line card board 2, and the number of first protocol messages identified as LP protocol is the largest. Then, the main control board CPU can determine the first protocol message as the target protocol message, determine line card board 2 as the target line card board, and determine LP protocol as the target protocol type.

[0097] Since the main control board CPU is the core component of the distributed device, almost all protocol messages are processed here. In many cases, network attackers will take advantage of this feature and attack the main control board by sending a large number of protocol messages, making it unable to work. Therefore, in one embodiment of the present application, after the main control board determines the target protocol message, it can determine that the target protocol message is an attack message.

[0098] It can be seen from the above embodiments that the main control board CPU records the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier, and determines the target protocol message with the largest number among the first protocol messages carrying the same source line card board identifier and the protocol type identifier based on the correspondence, so as to achieve faster determination of the target protocol message.

[0099] S203: Send a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card board to instruct the forwarding chip to reduce a rate of sending protocol messages of the target protocol type to the main control board CPU.

[0100] The target line card is a line card corresponding to the source line card identifier carried by the target protocol message, and the target protocol type is a protocol type indicated by the protocol type identifier carried by the target protocol message.

[0101] The first notification may be in the form of a notification message, or in other forms. The embodiment of the present application does not specifically limit the specific form of the first notification.

[0102] In one embodiment of the present application, in addition to carrying an identifier of the target protocol type, the above-mentioned first notification may also carry an instruction to reduce the sending rate, thereby instructing the forwarding chip of the target line card board to reduce the rate of sending protocol messages of the target protocol type to the main control board CPU.

[0103] In one embodiment of the present application, in addition to carrying the identifier of the target protocol type, the above-mentioned first notification may also carry an instruction to notify the target chip to send a protocol message of the target protocol type to the main control board at a first sending rate, thereby instructing the forwarding chip of the target line card board to send a protocol message of the target protocol type to the main control board CPU at the first sending rate. The first sending rate is less than or equal to the original rate at which the forwarding chip of the target line card board sends the protocol message of the target protocol type to the main control board CPU.

[0104] In an embodiment of the present application, the main control board CPU sends a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card board. After receiving the first notification, the forwarding chip of the target line card board specifically determines whether to reduce the rate of sending protocol messages of the target protocol type to the main control board CPU, or to maintain the rate of sending protocol messages of the target protocol type to the main control board CPU. For details, please refer to the description of the embodiments below.

[0105] In the technical solution provided in the embodiment of the present application, the main control board of the distributed device determines the first protocol message in which packet loss occurs in the previous detection cycle, and determines the target protocol message with the largest number among the first protocol messages carrying the same source line card board identifier and protocol type identifier. That is, the main control board can determine the protocol message (target protocol message) with the largest number of packet loss in the previous detection cycle and having the same source line card board identifier and protocol type identifier. Since the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message, the main control board can determine the target line card board that sends the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card board identifier and the protocol type identifier carried by the target protocol message, and then the main control board sends a first notification to the forwarding chip of the target line card board to instruct the above-mentioned forwarding chip to reduce the rate at which protocol messages of the target protocol type are sent to the main control board. It can be seen that the technical solution provided by the embodiment of the present application is that the main control board senses the protocol message with the largest number of packet losses in the previous detection cycle and the same source line card board identifier and protocol type identifier, and then determines the target line card board and the target protocol type based on the source line card board identifier and the protocol type identifier of the protocol message, thereby instructing the forwarding chip of the target line card board to reduce the sending rate of the protocol message of the target protocol type, that is, to achieve flow control on the sending end, thereby reducing the probability of protocol message loss on the same packet receiving channel of the main control board due to the presence of a large number of burst messages on the packet receiving channel.

[0106] In addition, in the technical solution provided in the embodiment of the present application, the main control board instructs the forwarding chip of the target line card board to reduce the rate of sending protocol messages of the target protocol type to the main control board, that is, the impact of the burst of protocol messages of the target protocol type on other protocol messages on the same packet receiving channel on the main control board is reduced. Compared with the method in which the main control board notifies all line card boards of the distributed device to reduce the rate of sending protocol messages of all protocol types to the main control board to reduce the probability of packet loss, the present solution only reduces the sending rate of protocol messages of the target protocol type by the target line card board, and therefore will not affect the sending of protocol messages of other protocol types by other line card boards, nor will it affect the sending of protocol messages of other protocol types by the target line card board, thereby improving the transmission performance between the main control board and the line card board of the distributed device.

[0107] See also Figure 3 , is a flow chart of a second flow control method provided in an embodiment of the present application, the method comprising steps S301 to S305, compared to Figure 2 In the illustrated embodiment, steps S301 to S303 are the same as the above-mentioned steps S201 to S203. After step 303, the method further includes steps S304 to S305.

[0108] S304: Monitor a first number of target protocol packets that are lost within a detection period after the first notification is sent.

[0109] In an embodiment of the present application, after the main control board CPU sends a first notification to the forwarding chip of the target line card board, the forwarding chip of the target line card board receives the first notification sent by the main control board, and then reduces or maintains the rate of sending protocol messages of the target protocol type to the main control board, that is, the forwarding chip of the target line card board takes corresponding flow control measures for the protocol messages of the target protocol type, and then the main control board CPU continuously monitors the first number of target protocol messages that have been lost within the detection period after sending the first notification, that is, after the sending end (the forwarding chip of the target line card board) takes flow control measures for the specified protocol message, the receiving end (main control board CPU) continuously counts the number of lost packets of the specified protocol message sent from the sending end to the receiving end according to the detection period, and then decides whether to send a second notification to the forwarding chip of the target line card board to instruct the forwarding chip of the target line card board to resume sending the protocol messages of the target protocol type to the main control board.

[0110] S305: If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the main control board CPU.

[0111] The values ​​of the first preset number and the preset number threshold can be set according to actual needs.

[0112] The second notification may be in the form of a notification message, or in other forms. The embodiment of the present application does not specifically limit the specific form of the second notification.

[0113] In an embodiment of the present application, if the first number monitored by the main control board CPU within a first preset number of consecutive detection cycles is less than a preset number threshold, it means that within a continuous period of time, the packet loss situation of the protocol message of the target protocol type sent by the forwarding chip of the target line card board on the packet receiving channel of the main control board CPU has been improved, so the main control board CPU sends a second notification carrying the identifier of the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to restore the rate of sending protocol messages of the target protocol type to the main control board. After receiving the second notification, the above-mentioned forwarding chip can directly restore the rate of sending protocol messages of the target protocol type to the main control board, or it can further determine whether to restore the rate of sending protocol messages of the target protocol type to the main control board by taking some steps. For details, please refer to the description of the embodiments below.

[0114] For ease of understanding, the following describes an example of a process in which the CPU of the main control board sends a second notification carrying an identifier of a target protocol type to a forwarding chip of a target line card.

[0115] Assume that the detection period is 1 hour, the second number is 3, and the preset number threshold is 1.

[0116] After the main control board CPU sends the first notification to the forwarding chip of the target line board, it continuously detects the number of target protocol messages that have been lost every hour. If the number of target protocol messages that have been lost in the first detection cycle is 5, the number of target protocol messages that have been lost in the second detection cycle is 6, the number of target protocol messages that have been lost in the third detection cycle is 0, the number of target protocol messages that have been lost in the fourth detection cycle is 0, and the number of target protocol messages that have been lost in the fifth detection cycle is 0, at this time, the main control board CPU detects that the number of target protocol messages that have been lost in three consecutive detection cycles is less than 1, then the main control board CPU sends a second notification carrying the identifier of the target protocol type to the forwarding chip of the target line board to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the main control board.

[0117] It can be seen from the above embodiments that the main control board CPU monitors the packet loss of the protocol messages of the target protocol type sent by the forwarding chip of the target line card board on its own packet receiving channel. After determining that the packet loss situation has improved over a continuous period of time, a second notification carrying the identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the above-mentioned forwarding chip to resume the rate of sending protocol messages of the target protocol type to the main control board CPU, thereby improving the transmission performance between the main control board CPU and the line card board and ensuring the normal processing of the protocol messages by the main control board CPU.

[0118] See also Figure 4 , is a flow chart of the third flow control method provided in the embodiment of the present application, which is applied to a forwarding chip of any line card board of a distributed device. For the convenience of description, the execution subject is referred to as the forwarding chip below. The above method includes the following steps S401-S402.

[0119] S401, sending a protocol message to a processor in a main control board of a distributed device.

[0120] The above-mentioned protocol message carries an active line card board identifier and a protocol type identifier, the source line card board identifier indicates the line card board that sends the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message.

[0121] In the embodiment of the present application, the line card board of the distributed device may include a CPU in addition to a forwarding chip, and the CPU may be divided into a CPU driver and a CPU platform. When the protocol message is processed by the distributed device, it first enters the line card board through the user port of the line card board. The forwarding chip of the line card board will identify the non-network layer protocol type of the protocol message, and based on the non-network layer protocol type of the protocol message, different types of protocol messages are added to different protocol channels, and the protocol messages are sent to the CPU driver of the line card board according to different protocol channels. After the CPU driver of the line card board processes the above-mentioned protocol message, the processed protocol message is sent to the CPU platform of the line card board through different protocol channels. After receiving the protocol message, the CPU platform of the line card board distinguishes different packet sending channels according to different network layer protocol types, and adds different types of protocol messages to different packet sending channels according to the network layer protocol type of the above-mentioned protocol message, and sends the protocol message to the main control board CPU according to different packet sending channels. Here, the process of the line card board sending the protocol message to the main control board is relatively simple, and the specific process can be referred to the above description.

[0122] S402: If a first notification carrying an identifier of a target protocol type is received from a processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained.

[0123] Among them, the above-mentioned target protocol type is: the processor in the main control board determines the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

[0124] In an embodiment of the present application, after the forwarding chip receives the first notification carrying the identifier of the target protocol type sent by the main control board CPU, the rate of sending the protocol message of the target protocol type to the main control board CPU is reduced or maintained. Here, the forwarding chip reduces or maintains the rate of sending the protocol message of the target protocol type to the main control board CPU, which can be understood as the forwarding chip reducing or maintaining the sending rate of the protocol channel corresponding to the target protocol type, and then the forwarding chip based on the protocol channel corresponding to the target protocol type, the rate of sending the protocol message of the target protocol type to the CPU driver becomes lower or remains unchanged, the rate at which the CPU driver sends the protocol message of the target protocol type to the CPU platform will also become lower or remain unchanged accordingly, and the rate at which the CPU platform sends the protocol message of the target protocol type to the main control board CPU will also become lower or remain unchanged accordingly, thereby achieving the effect of reducing or maintaining the rate of sending the protocol message of the target protocol type to the main control board CPU.

[0125] In addition, in the embodiment of the present application, flow control is performed at the forwarding chip end. Compared with flow control performed at the CPU driver end of the online card board, a burst protocol message can be processed more promptly, thereby further reducing the probability of protocol message loss on the packet receiving channel caused by a large number of burst messages on the same packet receiving channel of the main control board.

[0126] For the specific implementation method of the forwarding chip reducing or maintaining the rate of sending protocol messages of the target protocol type to the main control board, please refer to the description of the embodiments below.

[0127] In the technical solution provided in the embodiment of the present application, the main control board of the distributed device determines the first protocol message in which packet loss occurs in the previous detection cycle, and determines the target protocol message with the largest number among the first protocol messages carrying the same source line card board identifier and protocol type identifier. That is, the main control board can determine the protocol message (target protocol message) with the largest number of packet loss in the previous detection cycle and having the same source line card board identifier and protocol type identifier. Since the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message, the main control board can determine the target line card board that sends the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card board identifier and the protocol type identifier carried by the target protocol message, and then the main control board sends a first notification to the forwarding chip of the target line card board to instruct the above-mentioned forwarding chip to reduce the rate at which protocol messages of the target protocol type are sent to the main control board. It can be seen that the technical solution provided by the embodiment of the present application is that the main control board senses the protocol message with the largest number of packet losses in the previous detection cycle and the same source line card board identifier and protocol type identifier, and then determines the target line card board and the target protocol type based on the source line card board identifier and the protocol type identifier of the protocol message, thereby instructing the forwarding chip of the target line card board to reduce the sending rate of the protocol message of the target protocol type, that is, to achieve flow control on the sending end, thereby reducing the probability of protocol message loss on the same packet receiving channel of the main control board due to the presence of a large number of burst messages on the packet receiving channel.

[0128] In addition, in the technical solution provided in the embodiment of the present application, the main control board instructs the forwarding chip of the target line card board to reduce the rate of sending protocol messages of the target protocol type to the main control board, that is, the impact of the burst of protocol messages of the target protocol type on other protocol messages on the same packet receiving channel on the main control board is reduced. Compared with the method in which the main control board notifies all line card boards of the distributed device to reduce the rate of sending protocol messages of all protocol types to the main control board to reduce the probability of packet loss, the present solution only reduces the sending rate of protocol messages of the target protocol type by the target line card board, and therefore will not affect the sending of protocol messages of other protocol types by other line card boards, nor will it affect the sending of protocol messages of other protocol types by the target line card board, thereby improving the transmission performance between the main control board and the line card board of the distributed device.

[0129] In one embodiment of the present application, the manner in which the forwarding chip in the above step S402 reduces or maintains the rate of sending protocol messages of the target protocol type to the main control board can be implemented by the following steps S402A-S402B.

[0130] S402A: If the target protocol type is a specified protocol type, maintain a rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0131] The above-mentioned designated protocol type is: a protocol type whose sending rate is less than a preset rate threshold. The above-mentioned designated protocol may specifically be an LP protocol, an RPC protocol, and the like.

[0132] Specifically, if a protocol message of a certain protocol type on the forwarding chip is sent to the main control board CPU at a lower sending rate, the sending rate of the protocol message of the protocol type is originally slow. If the sending rate of the protocol message of the protocol type is further reduced on this basis, the sending rate of the protocol message of the protocol type will be too slow, which may affect the normal processing of the protocol message of the protocol type. Therefore, in one embodiment of the present application, when the forwarding chip determines that the target protocol type is a message of a specified protocol type, the rate of sending the protocol message of the target protocol type to the main control board is maintained, so as to ensure that the main control board CPU can process the protocol message of the target protocol type in a timely manner, thereby ensuring the normal operation of the distributed device.

[0133] S402B: If the target protocol type is a non-specified protocol type, reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0134] In one embodiment of the present application, when the forwarding chip determines that the target protocol type is a non-specified protocol type message, the rate of sending protocol messages of the target protocol type to the main control board CPU is reduced, thereby ensuring that the main control board CPU performs flow control on the protocol messages of the target protocol type and improving the packet loss situation of the protocol messages of the target protocol type.

[0135] It can be seen from the above embodiments that when the forwarding chip of the line card board receives the first notification carrying the identifier of the target protocol type sent by the main control board CPU, it determines whether the target protocol type is a specified protocol type message, and decides to reduce the rate of sending protocol messages of the target protocol type to the main control board, or maintain the rate of sending protocol messages of the target protocol type to the main control board, thereby realizing flexible flow control of protocol messages of the target protocol type on the forwarding chip.

[0136] See also Figure 5 , is a flow chart of a fourth flow control method provided in an embodiment of the present application, the method comprising steps S501-S503, and Figure 4 Compared with the embodiment shown, steps S501 to S502 are the same as the above steps S401 to S402, and after step S502, step S503 is further included.

[0137] S503: If a second notification carrying an identifier of the target protocol type is received, restore a rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0138] Among them, the second notification is: the processor in the main control board monitors the first number of target protocol messages that are lost within the detection period after sending the first notification, and sends it to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

[0139] In one embodiment of the present application, if the forwarding chip receives the second notification carrying the identifier of the target protocol type, it directly restores the rate of sending the protocol message of the target protocol type to the main control board. In this way, since the forwarding chip directly restores the rate of sending the protocol message of the target protocol type to the main control board, the transmission performance between the main control board CPU and the line card board can be improved, ensuring that the main control board CPU processes the protocol message in a timely manner.

[0140] It can be seen from the above embodiments that in the embodiments of the present application, if the forwarding chip receives a second notification carrying an identifier of the target protocol type, the forwarding chip directly resumes the rate of sending protocol messages of the target protocol type to the main control board, thereby improving the transmission performance between the main control board CPU and the line card board, and ensuring timely processing of the protocol messages by the main control board CPU.

[0141] See also Figure 6 , is a flow chart of a fifth flow control method provided in an embodiment of the present application, the method comprising steps S601-S605, and Figure 4 Compared with the embodiment shown, steps S601 to S602 are the same as the above steps S401 to S402, and after step S602, steps S603 to S605 are further included.

[0142] S603: Monitor a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification.

[0143] The values ​​of the second preset number and period can be set according to specific needs.

[0144] After receiving the protocol message sent from the outside, the forwarding chip also uses the queue method to process the protocol message. Specifically, after receiving the protocol message sent from the outside, the forwarding chip writes the protocol message to the corresponding protocol channel based on the non-network layer protocol type of the protocol message. If it exceeds the processing capacity of the forwarding chip, it will appear as congestion of the protocol channel, and the newly received protocol message will fail to be written into the protocol channel, and the protocol message on the protocol channel will be lost.

[0145] In one embodiment of the present application, after receiving the first notification of the identifier of the target protocol type, the forwarding chip can monitor the protocol channel corresponding to the identifier of the target protocol type on the forwarding chip, and monitor to obtain the second number of protocol messages of the target protocol type that have packet loss on the protocol channel within a first preset number of cycles. That is, after the forwarding chip adopts corresponding flow control measures for the protocol messages of the target protocol type, the number of packet loss of the protocol messages of the target protocol type on the forwarding chip is counted according to the cycle.

[0146] S604: If a second notification carrying an identifier of the target protocol type is received, monitor a third number of protocol packets of the target protocol type that are lost within a third preset number of periods after the second notification is received.

[0147] Among them, the second notification is that the processor in the main control board monitors the first number of target protocol messages that have been lost within the detection period after sending the first notification, and sends it to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

[0148] The values ​​of the third preset number and the period can be set according to specific requirements. The values ​​of the second preset number and the third preset number can be the same or different.

[0149] In one embodiment of the present application, after receiving the second notification, the forwarding chip can monitor the protocol channel corresponding to the identifier of the target protocol type on the forwarding chip, and monitor to obtain the second number of protocol messages of the target protocol type that have packet loss on the protocol channel within a second preset number of cycles. That is, after receiving the indication of the transmission rate of the protocol messages of the target protocol type sent by the main control board, the forwarding chip counts the number of packet loss of the protocol messages of the target protocol type on the forwarding chip according to the cycle.

[0150] S605: If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the main control board is restored.

[0151] The above preset ratio can be expressed in the form of a percentage or in the form of a fraction. The value of the preset ratio can be set based on actual needs. For example, the preset ratio can be set to 50%, that is, when the decrease of the third number relative to the second number reaches 50% of the ratio of the second number, the forwarding chip can restore the rate of sending protocol messages of the target protocol type to the main control board CPU. Assuming that the value of the second number is 10, when the value of the third number is 5, the decrease of the third number relative to the second number is 5, and the decrease of the third number relative to the second number is 50% of the ratio of the second number, reaching the preset ratio (50%), the forwarding chip can restore the rate of sending protocol messages of the target protocol type to the main control board CPU; when the value of the third number is 4, the decrease of the third number relative to the second number is 6, and the decrease of the third number relative to the second number is 60% of the ratio of the second number, also reaching the preset ratio (50%), the forwarding chip can restore the rate of sending protocol messages of the target protocol type to the main control board CPU.

[0152] In one embodiment of the present application, the second number can be understood as the number of lost packets of the target protocol type on the forwarding chip within a period of time after the forwarding chip adopts corresponding flow control measures for the protocol message of the target protocol type, and the third number can be understood as the number of lost packets of the target protocol type on the forwarding chip within a period of time after the forwarding chip receives the indication of the transmission rate of the protocol message of the target protocol type sent by the main control board CPU. Then the forwarding chip determines whether the ratio of the decrease of the third number relative to the second number and the second number has reached a preset ratio. If the preset ratio is reached, it can be indicated that the packet loss of the protocol message of the target protocol type on the forwarding chip has been improved within a period of time after the forwarding chip receives the indication of the transmission rate of the protocol message of the target protocol type sent by the main control board CPU, thereby reducing the possibility of a large number of sudden protocol messages of the target protocol type pouring into the same packet receiving channel of the main control board CPU in a short period of time. It can also be understood that the protocol messages sent by the external network attacker received by the forwarding chip have become less or even gone, and the network attack has ended, so the forwarding chip can restore the rate of sending the protocol message of the target protocol type to the main control board CPU.

[0153] It can be seen from the above embodiments that in the embodiments of the present application, the forwarding chip of the line card board in the distributed device monitors the number of packet loss of protocol messages of the target protocol type on the forwarding chip within a period of time after the forwarding chip adopts corresponding flow control measures for the protocol messages of the target protocol type, that is, the second number, and the number of packet loss of protocol messages of the target protocol type on the forwarding chip within a period of time after the forwarding chip receives an indication of restoring the sending rate of protocol messages of the target protocol type sent by the main control board CPU, that is, the third number. By judging whether the decrease in the third number relative to the second number and the ratio of the second number reach a preset ratio, it is determined whether the packet loss situation of protocol messages of the target protocol type on the forwarding chip has been improved, that is, the judgment condition for the forwarding chip to resume sending the protocol messages of the target protocol type to the main control board CPU is more stringent, thereby reducing the possibility of needing to perform flow control on the forwarding chip multiple times.

[0154] Based on the same inventive concept, the present application also provides a main control board, see Figure 7 , is a schematic diagram of the structure of a main control board provided in an embodiment of the present application, the main control board is located in a distributed device, and the processor 701 in the main control board is used to perform the following steps:

[0155] Determine a first protocol message in which packet loss occurs in the last detection cycle; wherein the first protocol message is sent by a forwarding chip in a line card board in the distributed device to a processor in the main control board;

[0156] Determine the target protocol message with the largest number in the first protocol message carrying the same source line card board identifier and protocol type identifier, wherein the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message;

[0157] A first notification carrying an identifier of a target protocol type is sent to a forwarding chip of a target line card board to instruct the forwarding chip to reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board, wherein the target line card board is the line card board corresponding to the source line card board identifier carried by the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried by the target protocol message.

[0158] In one embodiment of the present application, after sending a first notification carrying an identifier of a target protocol type to a forwarding chip of a target line card board to instruct the forwarding chip to reduce a rate at which protocol packets of the target protocol type are sent to the processor in the main control board, the processor 701 in the main control board is further configured to perform the following steps:

[0159] Monitoring a first number of target protocol packets that are lost within a detection period after sending the first notification;

[0160] If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the processor in the main control board.

[0161] In one embodiment of the present application, the processor in the main control board is specifically used to perform the following steps:

[0162] Recording the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier;

[0163] According to the corresponding relationship, the target protocol messages with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier are determined.

[0164] Based on the same inventive concept, the present application embodiment provides a line card board, see Figure 8 , is a structural diagram of a line card provided in an embodiment of the present application ( Figure 8 In the structure diagram of the line card board, only the forwarding chip 801 is shown), the line card board is any line card board in the distributed device, and the forwarding chip 801 in the line card board performs the following steps:

[0165] Sending a protocol message to a processor in a main control board of the distributed device, wherein the protocol message carries an active line card board identifier and a protocol type identifier, wherein the source line card board identifier indicates a line card board that sends the protocol message, and the protocol type identifier indicates a non-network layer protocol type corresponding to the protocol message;

[0166] If a first notification carrying an identifier of a target protocol type is received from the processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained;

[0167] Among them, the target protocol type is: the processor in the main control board determines that the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

[0168] In one embodiment of the present application, the forwarding chip 801 in the line card board is specifically used to perform the following steps:

[0169] If the target protocol type is a specified protocol type, maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board; the specified protocol type is: a protocol type whose sending rate is less than a preset rate threshold;

[0170] If the target protocol type is a non-specified protocol type, the rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced.

[0171] In one embodiment of the present application, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps:

[0172] If a second notification carrying an identifier of the target protocol type is received, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored, wherein the second notification is: the processor in the main control board monitors a first number of target protocol messages that are lost within a detection period after sending the first notification, and sends the message to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

[0173] In one embodiment of the present application, after reducing or maintaining the rate of sending target protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps:

[0174] Monitoring a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification;

[0175] If a second notification carrying an identifier of the target protocol type is received, a third number of protocol messages of the target protocol type that have been lost within a third preset number of cycles after receiving the second notification is monitored, wherein the second notification is a first number of target protocol messages that have been lost within a detection cycle after the processor in the main control board monitors and sends the first notification, and is sent to the forwarding chip when the first number monitored within a first preset number of detection cycles is less than a preset number threshold;

[0176] If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.

[0177] The present application also provides an electronic device, such as Fig. 9 As shown, it includes a main control board 901 and at least one line card board 902 ( Fig. 9The number of line card boards 902 shown in the figure is 1), the main control board is the main control board described in any of the above embodiments, and the line card board is the line card board described in any of the above embodiments.

[0178] In another embodiment provided in the present application, a computer-readable storage medium is also provided, which stores a computer program. When the computer program is executed by a processor in a main control board, it implements any of the above-mentioned flow control methods for the processor in the main control board of a distributed device.

[0179] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a forwarding chip in a line card board, any of the above-mentioned flow control methods for a forwarding chip in a line card board applied to a distributed device is implemented.

[0180] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any flow control method in the above embodiments.

[0181] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0182] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0183] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the main control board embodiment, line card board embodiment, electronic device embodiment and computer storage medium embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0184] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A flow control method, characterized in that: A processor applied to a main control board of a distributed device, the method comprising: Determine a first protocol message in which packet loss occurs in the last detection cycle; wherein the first protocol message is sent by a forwarding chip in a line card board in the distributed device to a processor in the main control board; Determine the target protocol message with the largest number in the first protocol message carrying the same source line card board identifier and protocol type identifier, wherein the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message; A first notification carrying an identifier of a target protocol type is sent to a forwarding chip of a target line card board to instruct the forwarding chip to reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board, wherein the target line card board is the line card board corresponding to the source line card board identifier carried by the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried by the target protocol message.

2. The method according to claim 1, characterized in that After sending a first notification carrying an identifier of a target protocol type to a forwarding chip of a target line card board to instruct the forwarding chip to reduce a rate of sending protocol packets of the target protocol type to a processor in the main control board, the method further includes: Monitoring a first number of target protocol packets that are lost within a detection period after sending the first notification; If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the processor in the main control board.

3. The method according to claim 1, characterized in that The determining of the target protocol message with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier includes: Recording the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier; According to the corresponding relationship, the target protocol messages with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier are determined.

4. A flow control method, characterized in that: A forwarding chip applied to any line card board of a distributed device, the method comprising: Sending a protocol message to a processor in a main control board of the distributed device, wherein the protocol message carries an active line card board identifier and a protocol type identifier, wherein the source line card board identifier indicates a line card board that sends the protocol message, and the protocol type identifier indicates a non-network layer protocol type corresponding to the protocol message; If a first notification carrying an identifier of a target protocol type is received from the processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained; Among them, the target protocol type is: the processor in the main control board determines that the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

5. The method according to claim 4, characterized in that The reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board includes: If the target protocol type is a specified protocol type, maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board; the specified protocol type is: a protocol type whose sending rate is less than a preset rate threshold; If the target protocol type is a non-specified protocol type, the rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced.

6. The method according to claim 4, characterized in that After reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the method further includes: If a second notification carrying an identifier of the target protocol type is received, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored, wherein the second notification is: the processor in the main control board monitors a first number of target protocol messages that are lost within a detection period after sending the first notification, and sends the message to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

7. The method according to claim 4, after reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, further comprises: Monitoring a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification; If a second notification carrying an identifier of the target protocol type is received, a third number of protocol messages of the target protocol type that have been lost within a third preset number of cycles after receiving the second notification is monitored, wherein the second notification is a first number of target protocol messages that have been lost within a detection cycle after the processor in the main control board monitors and sends the first notification, and is sent to the forwarding chip when the first number monitored within a first preset number of detection cycles is less than a preset number threshold; If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.

8. A main control board, characterized in that: The main control board is located in the distributed device, and the processor in the main control board is used to perform the following steps: Determine a first protocol message in which packet loss occurs in the last detection cycle; wherein the first protocol message is sent by a forwarding chip in a line card board in the distributed device to a processor in the main control board; Determine the target protocol message with the largest number in the first protocol message carrying the same source line card board identifier and protocol type identifier, wherein the source line card board identifier carried by the protocol message indicates the line card board that sends the protocol message, and the protocol type identifier carried by the protocol message indicates the non-network layer protocol type corresponding to the protocol message; A first notification carrying an identifier of a target protocol type is sent to a forwarding chip of a target line card board to instruct the forwarding chip to reduce the rate of sending protocol messages of the target protocol type to the processor in the main control board, wherein the target line card board is the line card board corresponding to the source line card board identifier carried by the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried by the target protocol message.

9. The main control board according to claim 8, characterized in that: After sending a first notification carrying an identifier of a target protocol type to a forwarding chip of a target line card board to instruct the forwarding chip to reduce a rate of sending protocol packets of the target protocol type to the processor in the main control board, the processor in the main control board is further configured to perform the following steps: Monitoring a first number of target protocol packets that are lost within a detection period after sending the first notification; If the first number monitored within a first preset number of consecutive detection cycles is less than a preset number threshold, a second notification carrying an identifier of the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the processor in the main control board.

10. The main control board according to claim 8, characterized in that: The processor in the main control board is specifically used to perform the following steps: Recording the correspondence between the source line card board identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card board identifier and the protocol type identifier; According to the corresponding relationship, the target protocol messages with the largest number among the first protocol messages carrying the same source line card identifier and protocol type identifier are determined.

11. A line card, characterized in that: The line card board is any line card board in a distributed device, and the forwarding chip in the line card board performs the following steps: Sending a protocol message to a processor in a main control board of the distributed device, wherein the protocol message carries an active line card board identifier and a protocol type identifier, wherein the source line card board identifier indicates a line card board that sends the protocol message, and the protocol type identifier indicates a non-network layer protocol type corresponding to the protocol message; If a first notification carrying an identifier of a target protocol type is received from the processor in the main control board, a rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced or maintained; Among them, the target protocol type is: the processor in the main control board determines that the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message in which packet loss occurred in the previous detection cycle, and the target protocol message is: the largest number of protocol messages in the first protocol message that carry the same source line card board identifier and protocol type identifier.

12. The line card board according to claim 11, characterized in that: The forwarding chip in the line card board is specifically used to perform the following steps: If the target protocol type is a specified protocol type, maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board; the specified protocol type is: a protocol type whose sending rate is less than a preset rate threshold; If the target protocol type is a non-specified protocol type, the rate of sending protocol messages of the target protocol type to the processor in the main control board is reduced.

13. The line card board according to claim 11, characterized in that: After reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps: If a second notification carrying an identifier of the target protocol type is received, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored, wherein the second notification is: the processor in the main control board monitors a first number of target protocol messages that are lost within a detection period after sending the first notification, and sends the message to the forwarding chip when the first number monitored within a first preset number of consecutive detection periods is less than a preset number threshold.

14. The line card board according to claim 11, characterized in that: After reducing or maintaining the rate of sending protocol messages of the target protocol type to the processor in the main control board, the forwarding chip in the line card board is further used to perform the following steps: Monitoring a second number of protocol packets of the target protocol type that are lost within a second preset number of periods after receiving the first notification; If a second notification carrying an identifier of the target protocol type is received, a third number of protocol messages of the target protocol type that have been lost within a third preset number of cycles after receiving the second notification is monitored, wherein the second notification is a first number of target protocol messages that have been lost within a detection cycle after the processor in the main control board monitors and sends the first notification, and is sent to the forwarding chip when the first number monitored within a first preset number of detection cycles is less than a preset number threshold; If the ratio of the decrease of the third number relative to the second number to the second number reaches a preset ratio, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.

15. An electronic device, characterized in that: The electronic device comprises a main control board and at least one line card board, wherein the main control board is the main control board described in any one of claims 8-10, and the line card board is the line card board described in any one of claims 11-14.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor in the main control board, the method steps described in any one of claims 1 to 3 are implemented.

17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the forwarding chip in the line card board, the method steps described in any one of claims 4 to 7 are implemented.

Citation Information

Patent Citations

  • Method for preventing DSLAM device from protocol packet attack based on network processor

    CN101188607A

  • Hierarchical rate limiting of control packets

    CN102415062A

  • Message processing method, device and system

    CN104104592A

  • Bandwidth allocation method and related equipment

    CN115567803A

  • Method for controlling protocol message attack

    CN1677933A

Cited By

  • Upload rate control method of protocol message and electronic equipment

    CN121644004A