A flow control method, main control board, line card board, electronic equipment and medium.
By identifying and adjusting the protocol message rate of the target line card by the main control board, the problem of packet loss caused by sudden messages on the same receiving channel in distributed devices is solved, thereby improving transmission efficiency and performance.
Patent Information
- Application Number
- CN202510059478.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-01-14
AI Technical Summary
In distributed devices, due to differences in how CPU platforms and CPU drivers distinguish channels, a large number of burst messages may appear on the same receiving channel, resulting in protocol message loss.
The main control board determines the protocol messages that were lost in the previous detection cycle, identifies the target message with the largest number of messages carrying the same source line card identifier and protocol type identifier, sends a notification to the forwarding chip of the target line card, instructs it to reduce the message rate of the target protocol type, and adjusts the rate by monitoring the number of lost packets.
This reduces the probability of protocol message loss on the same receiving channel of the main control board, improves the transmission performance between the main control board and the line card board, and avoids impacting other line cards board.
Smart Images

Figure CN119892748B_ABST
Abstract
Description
Technical Field
[0001] This 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 Technology
[0002] Distributed devices typically consist of a master control board (Mr) and multiple line cards (LCs). Mr includes a central processing unit (CPU), and LCs include forwarding chips and the CPU itself. The CPU can be further divided into a CPU driver and a CPU platform. When protocol messages are processed by the distributed device, they first enter the LC through the LC's user port. The LC's forwarding chip identifies the type of the protocol message and, based on this type, adds different types of protocol messages to different protocol channels. These messages are then sent to the LC's CPU driver according to their respective channels. After processing, the LC's CPU driver sends the processed message to the LC's CPU platform via the designated protocol channels. Upon receiving the message, the LC's CPU platform forwards it to Mr, allowing Mr's CPU to process it.
[0003] When the LC CPU platform sends protocol messages to Mr, it also distinguishes different sending channels according to different protocol types, and Mr will also distinguish different receiving channels accordingly. However, the way the CPU platform distinguishes sending channels is based on network layer protocols, while the way the CPU driver distinguishes protocol channels is based on non-network layer protocols. The two methods of channel distinction are different. This will cause protocol messages from different protocol channels of the CPU driver to arrive at the CPU platform. The CPU platform will send protocol messages of the same network layer protocol in these different types of protocol messages to Mr through the same sending channel. When multiple LC CPU platforms send different types of protocol messages to Mr at the same time, it may cause a large number of sudden messages to appear on the same receiving channel of Mr in a short period of time, resulting in packet loss of protocol messages on the receiving channel. Summary of the Invention
[0004] The purpose of this 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 packet loss on the same packet receiving channel when a large number of sudden packets exist on the same receiving channel of the main control board. The specific technical solution is as follows:
[0005] In a first aspect, embodiments of this application provide a flow control method applied to a processor in the main control board of a distributed device, the method comprising:
[0006] The first protocol message that was lost in the previous detection period is identified; wherein, the first protocol message is sent from the forwarding chip in the line card board of the distributed device to the processor in the main control board;
[0007] Identify the target protocol message that has the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, wherein the source line card identifier carried by the protocol message indicates the line card that sent 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 the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board. The target line card is the line card corresponding to the source line card 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 this application, after sending a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board, the method further includes:
[0010] The first number of target protocol packets that are lost within the detection period after the first notification is sent;
[0011] If the first number detected within a first preset number of 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 board 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 this application, 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 includes:
[0013] Record the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the protocol type identifier;
[0014] Based on the correspondence, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier is determined.
[0015] Secondly, embodiments of this application provide a flow control method applied to a forwarding chip in any line card of a distributed device, the method comprising:
[0016] A protocol message is sent to the processor in the main control board of the distributed device. The protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message.
[0017] If a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained.
[0018] The target protocol type is determined by the processor in the main control board, which identifies the protocol type carried by the protocol type identifier in the first protocol message that was lost in the previous detection cycle. The target protocol message is the protocol message that carries the same source line card identifier and protocol type identifier among the most numerous first protocol messages.
[0019] In one embodiment of this application, reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board includes:
[0020] If the target protocol type is a specified protocol type, maintain the rate at which protocol messages of the target protocol type are sent 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, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
[0022] In one embodiment of this application, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent 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. The second notification is sent by the processor in the main control board to the forwarding chip when the first number of target protocol messages lost within a detection period after the first notification is sent is less than a preset number threshold.
[0024] In one embodiment of this application, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the method further includes:
[0025] The 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 is monitored.
[0026] If a second notification carrying an identifier of the target protocol type is received, the third number of target protocol type protocol messages that have been lost within a third preset number of periods after receiving the second notification is monitored. The second notification is sent to the forwarding chip by the processor in the main control board when it monitors the first number of target protocol messages that have been lost within a detection period after sending the first notification.
[0027] If the decrease in the third quantity relative to the second quantity is proportional to the second quantity, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.
[0028] Thirdly, embodiments of this application provide a main control board, which is located in a distributed device, and the processor in the main control board is used to perform the following steps:
[0029] The first protocol message that was lost in the previous detection period is identified; wherein, the first protocol message is sent from the forwarding chip in the line card board of the distributed device to the processor in the main control board;
[0030] Identify the target protocol message that has the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, wherein the source line card identifier carried by the protocol message indicates the line card that sent 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 the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board. The target line card is the line card corresponding to the source line card 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 this application, after sending a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages 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:
[0033] The first number of target protocol packets that are lost within the detection period after the first notification is sent;
[0034] If the first number detected within a first preset number of 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 board 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 this application, the processor in the main control board is specifically used to perform the following steps:
[0036] Record the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the protocol type identifier;
[0037] Based on the correspondence, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier is determined.
[0038] Fourthly, this application provides a line card board, which is any line card board in a distributed device, and the forwarding chip in the line card board performs the following steps:
[0039] A protocol message is sent to the processor in the main control board of the distributed device. The protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message.
[0040] If a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained.
[0041] The target protocol type is determined by the processor in the main control board, which identifies the protocol type carried by the protocol type identifier in the first protocol message that was lost in the previous detection cycle. The target protocol message is the protocol message that carries the same source line card identifier and protocol type identifier among the most numerous first protocol messages.
[0042] In one embodiment of this 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, maintain the rate at which protocol messages of the target protocol type are sent 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, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
[0045] In one embodiment of this application, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured 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. The second notification is sent by the processor in the main control board to the forwarding chip when the first number of target protocol messages lost within a detection period after the first notification is sent is less than a preset number threshold.
[0047] In one embodiment of this application, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured to perform the following steps:
[0048] The 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 is monitored.
[0049] If a second notification carrying an identifier of the target protocol type is received, the third number of target protocol type protocol messages that have been lost within a third preset number of periods after receiving the second notification is monitored. The second notification is sent to the forwarding chip by the processor in the main control board when it monitors the first number of target protocol messages that have been lost within a detection period after sending the first notification.
[0050] If the decrease in the third quantity relative to the second quantity is proportional to the second quantity, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.
[0051] This application also provides an electronic device, which includes 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] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor in a main control board, implements any of the above-described flow control methods for processors in main control boards applied to distributed devices.
[0053] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by the forwarding chip in the line card board, it implements any of the above-mentioned flow control methods for the forwarding chip in the line card board applied to distributed devices.
[0054] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the flow control methods described above.
[0055] Beneficial effects of the embodiments in this application:
[0056] In the technical solution provided in this application embodiment, the main control board of the distributed device determines the first protocol message that experienced packet loss in the previous detection period, and determines the target protocol message with the largest number of first protocol messages carrying the same source line card 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 losses in the previous detection period and the same source line card identifier and protocol type identifier. Since the source line card identifier carried by the protocol message indicates the line card that sent 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 that sent the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card identifier and protocol type identifier carried by the target protocol message. Then, the main control board sends a first notification to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. As can be seen, the technical solution provided in this application embodiment allows the main control board to sense the protocol messages with the most packet loss in the previous detection period that have the same source line card identifier and protocol type identifier. Based on the source line card identifier and protocol type identifier of the protocol message, the main control board determines the target line card and the target protocol type, thereby instructing the forwarding chip of the target line card to reduce the transmission rate of the protocol messages of the target protocol type. This achieves flow control at the sending end, thereby reducing the probability of packet loss of protocol messages on the same receiving channel when there are a large number of sudden packets on the same receiving channel of the main control board.
[0057] Furthermore, in the technical solution provided in this application embodiment, the main control board instructs the forwarding chip of the target line card to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. That is, it reduces the impact of bursts of protocol messages of the target protocol type on other protocol messages on the same receiving channel on the main control board. Compared with the method of the main control board notifying all line cards of the distributed device to reduce the rate at which it sends protocol messages of all protocol types to the main control board in order to reduce the probability of packet loss, this solution only reduces the sending rate of protocol messages of the target protocol type sent by the target line card. Therefore, it will not affect the sending of protocol messages by other line cards, nor will it affect the sending of protocol messages of other protocol types by the target line card. This can improve the transmission performance between the main control board and the line cards of the distributed device.
[0058] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0060] Figure 1 This application provides a schematic diagram of the structure of a distributed device according to an embodiment of the present application.
[0061] Figure 2 A flowchart illustrating the first flow control method provided in this application embodiment;
[0062] Figure 3 A flowchart illustrating the second flow control method provided in this application embodiment;
[0063] Figure 4 A flowchart illustrating the third flow control method provided in this application embodiment;
[0064] Figure 5 A flowchart illustrating the fourth flow control method provided in this application embodiment;
[0065] Figure 6 A flowchart illustrating the fifth flow control method provided in this application embodiment;
[0066] Figure 7 This is a schematic diagram of the structure of a main control board provided in an embodiment of this application;
[0067] Figure 8 This is a schematic diagram of the structure of a line card provided in an embodiment of this application;
[0068] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0070] See Figure 1 This is a schematic diagram of the structure of a distributed device provided in an embodiment of this application. Figure 1 The distributed device shown includes one main control board 101 and two line cards 102, which do not serve a limiting function. The main control board 101 includes a CPU, and the line cards 102 include a forwarding chip and a CPU. The CPU can be further divided into a CPU driver and a CPU platform.
[0071] The following combination Figure 1 This section describes the process by which the line card of a distributed device sends protocol messages to the main control board of the distributed device.
[0072] When protocol messages are processed by distributed devices, they first enter line card 102 via the user port. The forwarding chip of line card 102 identifies 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 then sent to the CPU driver of line card 102 according to the different protocol channels. Here, each non-network layer protocol type corresponds to at least one protocol channel. For example, the forwarding chip writes RPC protocol type messages to protocol channel 1 and protocol channel 2, LP protocol type messages to protocol channel 3, DSP protocol type messages to protocol channel 4, and OSPF protocol type messages 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 through different protocol channels.
[0074] After receiving the protocol messages from the CPU, the CPU platform of line card 102 distinguishes the sending channels according to different network layer protocol types. Based on the network layer protocol type of the protocol messages, it adds different types of protocol messages to different sending channels and sends the protocol messages to the CPU of main control board 101 according to the different sending channels, so that the CPU of main control board 101 can process the protocol messages. Correspondingly, the CPU of main control board 101 also distinguishes the receiving channels according to different network layer protocol types, that is, the above-mentioned sending channels and receiving channels correspond. Here, the network layer protocol type can specifically be Internet Protocol version 4 (IPv4), Internet Protocol version 6 (IPv6), or Multi-Protocol Label Switching (MPLS). Each network layer protocol corresponds to at least one receiving channel. For example, the CPU platform writes IPv4 protocol packets to packet sending channel 1 and packet sending channel 2, IPv6 protocol packets to packet sending channel 3, and MPLS protocol packets to packet sending channel 4.
[0075] Because the CPU platform distinguishes packet transmission channels based on network layer protocols, while the CPU driver distinguishes protocol channels based on non-network layer protocols, their methods differ. This results in protocol packets from different protocol channels arriving at the CPU platform via the CPU driver being sent to the CPU of the main control board 101 via the same packet transmission channel if they belong to the same network layer protocol. For example, protocol packets from protocol channels 1 and 3-5, upon arriving at the CPU platform, will be sent to the CPU of the main control board 101 via packet transmission channel 1, while protocol packets from protocol channel 2, upon arriving at the CPU platform, will be sent to the CPU of the main control board 101 via 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, it may cause a large number of sudden messages to appear on the same receiving channel of the CPU of the main control board 101 in a short period of time, resulting in packet loss of protocol messages on the receiving channel.
[0077] To address the aforementioned issues, embodiments of this application provide a flow control method, a main control board, a line card board, and a device.
[0078] See Figure 2This is a flowchart illustrating the first flow control method provided in this application embodiment, applied to the CPU in the main control board of a distributed device. For ease of description, the executing entity will be 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, identify the first protocol message that was lost in the previous detection cycle.
[0080] The first protocol message is sent from the forwarding chip in the line card board of the distributed device to the main control board.
[0081] Specifically, the messages received by the distributed device can be divided into control plane protocol messages and data plane data messages. After any line card in the distributed device receives a message, its forwarding chip performs type parsing to determine whether it is a protocol message or a data message. If it is determined to be a protocol message, it is sent to the main control board CPU of the distributed device for processing. The specific process of the forwarding chip in the line card sending protocol messages to the main control board CPU can be found in the description above.
[0082] The main control board CPU receives protocol messages from the line cards and processes them using an enqueue method. Specifically, after receiving a protocol message from a line card, the main control board CPU writes it to the corresponding receive channel. If the processing capacity of the main control board CPU is exceeded, it will result in receive channel congestion, and newly received protocol messages will fail to be written to the receive channel, leading to packet loss. These lost protocol messages are collectively referred to as the first protocol message. Since multiple line cards in the distributed device send protocol messages to the main control board, the first protocol message that experiences packet loss can originate from only one line card in the distributed device and be sent to the main control board's CPU chip, or it can originate from multiple line cards in the distributed device and be sent to the main control board's CPU chip.
[0083] The specific value of the above-mentioned detection cycle can be set based on requirements. For example, the detection cycle can be set to 1 hour or 30 minutes. The solution provided in this application does not limit the specific duration of the detection cycle.
[0084] In this embodiment of the 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, thereby determining the first protocol message that was lost on the packet receiving channel in the previous detection period at the moment of packet loss.
[0085] S202, identify the target protocol message that has the largest number of first protocol messages carrying the same source card identifier and protocol type identifier.
[0086] The source line card identifier carried in the protocol message indicates the line card that sent 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 aforementioned 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 in the distributed device sends a protocol message to the main control board CPU, it carries the source line card identifier and the protocol type identifier in the protocol message. This provides a basis for the main control board CPU to specifically notify the forwarding chip of the target line card, instructing the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the main control board CPU.
[0088] In this embodiment of the application, after the main control board CPU determines that a first protocol message that has been lost in the previous detection cycle, it can count the first protocol messages according to the source card identifier and protocol type identifier carried by the first protocol message, and then determine the target protocol message with the largest number of first protocol messages that carry the same source card identifier and protocol type identifier.
[0089] In one embodiment of this application, the main control board CPU can determine, based on steps A-B, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier.
[0090] Step A: Record the correspondence between the source card identifier and the protocol type identifier and the number of first protocol messages carrying the same source card identifier and protocol type identifier.
[0091] The main control board CPU can count the first protocol messages carrying the same source line card identifier and protocol type identifier according to the source line card identifier and protocol type identifier carried in the first protocol message, and then record the correspondence between the source line card identifier and protocol type identifier and the number of first protocol messages carrying the same source line card identifier and protocol type identifier. The above correspondence can be represented and stored in the form of a table, or it can be represented and stored in other forms. The embodiments of this application do not specifically limit the form of the above correspondence.
[0092] Step B: Based on the correspondence, determine the target protocol message with the largest number of first protocol messages that carry the same source line card identifier and protocol type identifier.
[0093] The following example uses a table to illustrate the process of identifying the most numerous target protocol messages among the first protocol messages carrying the same source card identifier and protocol type identifier.
[0094] Specifically, see Table 1, which is a schematic diagram showing the correspondence between the recorded source card identifier and protocol type identifier and the number of first protocol messages carrying the same source card identifier and protocol type identifier after statistically counting the first protocol messages carried by the first protocol messages in the previous testing cycle.
[0095] Table 1
[0096]
[0097] As shown in Table 1 above, the source line card is identified as line card 2, and the number of first protocol messages with the protocol type identified as LP protocol is the largest. Therefore, the main control board CPU can identify the first protocol message as the target protocol message, identify line card 2 as the target line card, and identify LP protocol as the target protocol type.
[0098] Since the main control board CPU is the core component of the distributed device, almost all protocol messages are processed here. Often, network attackers exploit this characteristic by sending a large number of protocol messages to attack the main control board, rendering it inoperable. Therefore, in one embodiment of this application, after the main control board identifies a target protocol message, it can determine that the target protocol message is an attack message.
[0099] As can be seen from the above embodiments, the main control board CPU records the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the same protocol type identifier. Based on the correspondence, it determines the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, so as to achieve faster determination of the target protocol message.
[0100] S203, send a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the main control board CPU.
[0101] Among them, the target line card is the line card corresponding to the source line card identifier carried in the target protocol message, and the target protocol type is the protocol type indicated by the protocol type identifier carried in the target protocol message.
[0102] The first notification mentioned above can take the form of a notification message, or it can take other forms. This application does not specifically limit the form of the first notification in its embodiments.
[0103] In one embodiment of this application, the first notification may carry not only an identifier of the target protocol type, but also an indication to reduce the transmission rate, thereby instructing the forwarding chip of the target line card to reduce the rate at which it sends protocol messages of the target protocol type to the main control board CPU.
[0104] In one embodiment of this application, the first notification, in addition to carrying an identifier of the target protocol type, may also carry an instruction to notify the target chip to send protocol messages 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 to send protocol messages 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 sends protocol messages of the target protocol type to the main control board CPU.
[0105] In this embodiment, 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. After receiving the first notification, the forwarding chip of the target line card further determines whether to reduce the rate at which it sends protocol messages of the target protocol type to the main control board CPU or to maintain the rate at which it sends protocol messages of the target protocol type to the main control board CPU. For details, please refer to the description of the embodiments below.
[0106] In the technical solution provided in this application embodiment, the main control board of the distributed device determines the first protocol message that experienced packet loss in the previous detection period, and determines the target protocol message with the largest number of first protocol messages carrying the same source line card 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 losses in the previous detection period and the same source line card identifier and protocol type identifier. Since the source line card identifier carried by the protocol message indicates the line card that sent 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 that sent the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card identifier and protocol type identifier carried by the target protocol message. Then, the main control board sends a first notification to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. As can be seen, the technical solution provided in this application embodiment allows the main control board to sense the protocol messages with the most packet loss in the previous detection period that have the same source line card identifier and protocol type identifier. Based on the source line card identifier and protocol type identifier of the protocol message, the main control board determines the target line card and the target protocol type, thereby instructing the forwarding chip of the target line card to reduce the transmission rate of the protocol messages of the target protocol type. This achieves flow control at the sending end, thereby reducing the probability of packet loss of protocol messages on the same receiving channel when there are a large number of sudden packets on the same receiving channel of the main control board.
[0107] Furthermore, in the technical solution provided in this application embodiment, the main control board instructs the forwarding chip of the target line card to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. That is, it reduces the impact of bursts of protocol messages of the target protocol type on other protocol messages on the same receiving channel on the main control board. Compared with the method of the main control board notifying all line cards of the distributed device to reduce the rate at which it sends protocol messages of all protocol types to the main control board in order to reduce the probability of packet loss, this solution only reduces the sending rate of protocol messages of the target protocol type sent by the target line card. Therefore, it will not affect the sending of protocol messages by other line cards, nor will it affect the sending of protocol messages of other protocol types by the target line card. This can improve the transmission performance between the main control board and the line cards of the distributed device.
[0108] See Figure 3 This is a flowchart illustrating a second flow control method provided in an embodiment of this application. The method includes steps S301-S305, compared to... Figure 2 In the embodiment shown, steps S301-S303 are the same as steps S201-S203 above. After step 303, the method further includes steps S304-S305.
[0109] S304, Monitor the first number of target protocol messages that are lost within the detection period after the first notification is sent.
[0110] In this embodiment, after the main control board CPU sends a first notification to the forwarding chip of the target line card, the forwarding chip of the target line card receives the first notification from the main control board and then reduces or maintains the rate at which it sends protocol messages of the target protocol type to the main control board. That is, the forwarding chip of the target line card takes corresponding flow control measures for the protocol messages of the target protocol type. Then, the main control board CPU continuously monitors the first number of target protocol messages that are lost within the detection period after sending the first notification. In other words, after the sending end (the forwarding chip of the target line card) takes flow control measures for the specified protocol messages, the receiving end (the main control board CPU) continuously counts the number of lost packets of the specified protocol messages 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, instructing the forwarding chip of the target line card to restore the rate at which it sends protocol messages of the target protocol type to the main control board.
[0111] S305, if the first number detected within a first preset number of 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 board to instruct the forwarding chip to resume the rate of sending protocol messages of the target protocol type to the main control board CPU.
[0112] The values of the first preset quantity and the preset quantity threshold can be set according to actual needs.
[0113] The second notification described above can take the form of a notification message, or other forms. This application does not specifically limit the form of the second notification in its embodiments.
[0114] In this embodiment, if the first quantity detected by the main control board CPU within a first preset number of detection cycles is less than a preset threshold, it indicates that the packet loss of protocol messages of the target protocol type sent by the forwarding chip of the target line card on the main control board CPU's packet receiving channel has been improved over a continuous period of time. Therefore, the main control board CPU sends a second notification carrying an 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 forwarding chip can directly restore the rate of sending protocol messages of the target protocol type to the main control board, or it can take some steps to further determine whether to restore the rate of sending protocol messages of the target protocol type to the main control board. For details, please refer to the description of the embodiments below.
[0115] To facilitate understanding, the following example illustrates the process by which the main control board CPU sends a second notification carrying an identifier of the target protocol type to the forwarding chip of the target line card.
[0116] Assume the detection period is 1 hour, the second quantity is 3, and the preset quantity threshold is 1.
[0117] After the main control board CPU sends the first notification to the forwarding chip of the target line card, it continuously monitors the number of target protocol packets that are lost every hour. If the number of target protocol packets that are lost is 5 in the first monitoring period, 6 in the second monitoring period, 0 in the third monitoring period, 0 in the fourth monitoring period, and 0 in the fifth monitoring period, then the main control board CPU detects that the number of target protocol packets that are lost in the three consecutive monitoring periods is less than 1. In this case, 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 resume the rate of sending protocol packets of the target protocol type to the main control board.
[0118] As can be seen from the above embodiments, the main control board CPU monitors the packet loss of protocol messages of the target protocol type sent by the forwarding chip of the target line card on its own packet receiving channel. When it is determined that the packet loss situation has improved over a continuous period of time, it 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 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 and ensuring the normal processing of protocol messages by the main control board CPU.
[0119] See Figure 4 This is a flowchart illustrating the third flow control method provided in this application embodiment, applied to the forwarding chip of any line card in a distributed device. For ease of description, the executing entity will be referred to as the forwarding chip below. The above method includes the following steps S401-S402.
[0120] S401 sends protocol messages to the processor in the main control board of the distributed device.
[0121] The aforementioned protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message.
[0122] In this embodiment, the line card board of the distributed device may include a CPU in addition to a forwarding chip. The CPU can be further divided into a CPU driver and a CPU platform. When protocol messages are processed by the distributed device, they first enter the line card board through the user port. The forwarding chip of the line card board identifies the non-network layer protocol type of the protocol message. Based on the non-network layer protocol type, it adds different types of protocol messages to different protocol channels and sends them to the CPU driver of the line card board according to the different protocol channels. After processing the protocol messages, the CPU driver of the line card board sends the processed protocol messages to the CPU platform of the line card board through different protocol channels. After receiving the protocol messages, the CPU platform of the line card board distinguishes different packet transmission channels according to different network layer protocol types. Based on the network layer protocol type of the protocol messages, it adds different types of protocol messages to different packet transmission channels and sends them to the main control board CPU according to the different packet transmission channels. The process of the line card board sending protocol messages to the main control board is simplified here; the specific process can be found in the description above.
[0123] S402, if a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained.
[0124] The target protocol type is: the protocol type indicated by the protocol type identifier carried by the target protocol message in the first protocol message that was lost in the previous detection cycle, as determined by the processor in the main control board. The target protocol message is: the protocol message with the most occurrences in the first protocol message that carries the same source line card identifier and protocol type identifier.
[0125] In this embodiment, after receiving a first notification carrying an identifier of the target protocol type sent by the main control board CPU, the forwarding chip reduces or maintains the rate at which it sends protocol messages of the target protocol type to the main control board CPU. Here, reducing or maintaining the rate at which the forwarding chip sends protocol messages of the target protocol type to the main control board CPU can be understood as the forwarding chip reducing or maintaining the transmission rate of the protocol channel corresponding to the target protocol type. Consequently, based on the protocol channel corresponding to the target protocol type, the rate at which the forwarding chip sends protocol messages of the target protocol type to the CPU driver becomes lower or remains unchanged. The rate at which the CPU driver sends protocol messages of the target protocol type to the CPU platform also becomes lower or remains unchanged, and the rate at which the CPU platform sends protocol messages of the target protocol type to the main control board CPU also becomes lower or remains unchanged, thereby achieving the effect of reducing or maintaining the rate at which the forwarding chip sends protocol messages of the target protocol type to the main control board CPU.
[0126] In addition, in this embodiment, flow control is performed on the forwarding chip side. Compared with flow control on the CPU driver side of the online card board, it can process a sudden burst of protocol messages more promptly, thereby further reducing the probability of packet loss on the same receiving channel of the main control board due to a large number of sudden packets.
[0127] For details on how the forwarding chip reduces or maintains the rate at which it sends protocol messages of the target protocol type to the main control board, please refer to the description of the embodiments below.
[0128] In the technical solution provided in this application embodiment, the main control board of the distributed device determines the first protocol message that experienced packet loss in the previous detection period, and determines the target protocol message with the largest number of first protocol messages carrying the same source line card 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 losses in the previous detection period and the same source line card identifier and protocol type identifier. Since the source line card identifier carried by the protocol message indicates the line card that sent 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 that sent the target protocol message and the target protocol type corresponding to the target protocol message based on the source line card identifier and protocol type identifier carried by the target protocol message. Then, the main control board sends a first notification to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. As can be seen, the technical solution provided in this application embodiment allows the main control board to sense the protocol messages with the most packet loss in the previous detection period that have the same source line card identifier and protocol type identifier. Based on the source line card identifier and protocol type identifier of the protocol message, the main control board determines the target line card and the target protocol type, thereby instructing the forwarding chip of the target line card to reduce the transmission rate of the protocol messages of the target protocol type. This achieves flow control at the sending end, thereby reducing the probability of packet loss of protocol messages on the same receiving channel when there are a large number of sudden packets on the same receiving channel of the main control board.
[0129] Furthermore, in the technical solution provided in this application embodiment, the main control board instructs the forwarding chip of the target line card to reduce the rate at which it sends protocol messages of the target protocol type to the main control board. That is, it reduces the impact of bursts of protocol messages of the target protocol type on other protocol messages on the same receiving channel on the main control board. Compared with the method of the main control board notifying all line cards of the distributed device to reduce the rate at which it sends protocol messages of all protocol types to the main control board in order to reduce the probability of packet loss, this solution only reduces the sending rate of protocol messages of the target protocol type sent by the target line card. Therefore, it will not affect the sending of protocol messages by other line cards, nor will it affect the sending of protocol messages of other protocol types by the target line card. This can improve the transmission performance between the main control board and the line cards of the distributed device.
[0130] In one embodiment of this application, the method by which the forwarding chip reduces or maintains the rate at which it sends protocol messages of the target protocol type to the main control board in step S402 can be achieved through the following steps S402A-S402B.
[0131] S402A: If the target protocol type is a specified protocol type, maintain the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
[0132] The specified protocol type is one whose transmission rate is less than a preset rate threshold. Specifically, the specified protocol can be an LP protocol, an RPC protocol, etc.
[0133] Specifically, if a protocol message of a certain protocol type is sent to the main control board CPU at a low transmission rate on the forwarding chip, the transmission rate of that protocol message type is already slow. If the transmission rate of that protocol message type is further reduced, the transmission rate will be too slow, which may affect the normal processing of that protocol message type. Therefore, in one embodiment of this application, when the forwarding chip determines that the target protocol type is a specified protocol message type, it maintains the rate at which it sends the target protocol message type to the main control board. This ensures that the main control board CPU processes the target protocol message type in a timely manner, thereby ensuring the normal operation of the distributed device.
[0134] S402B: If the target protocol type is a non-specified protocol type, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
[0135] In one embodiment of this application, when the forwarding chip determines that the target protocol type is a non-specified protocol type packet, it reduces the rate at which it sends the target protocol type protocol packets to the main control board CPU, thereby ensuring that the main control board CPU performs flow control on the target protocol type protocol packets and improving the packet loss situation of the target protocol type protocol packets.
[0136] As can be seen from the above embodiments, when the forwarding chip of the line card receives the first notification carrying the identifier of the target protocol type sent by the CPU of the main control board, it determines whether the target protocol type is a specified protocol type message, and decides to reduce the rate of sending the target protocol type protocol message to the main control board or maintain the rate of sending the target protocol type protocol message to the main control board, thereby realizing flexible flow control of the target protocol type protocol message on the forwarding chip.
[0137] See Figure 5 This is a flowchart illustrating the fourth flow control method provided in this application embodiment. The method includes steps S501-S503, which are the same as those described above. Figure 4 Compared to the embodiment shown, steps S501-S502 are the same as steps S401-S402 above, and step S503 is included after step S502.
[0138] S503, 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.
[0139] The second notification is: the processor in the main control board monitors the first number of target protocol packets that are lost within the detection period after the first notification is sent, and sends it to the forwarding chip when the first number monitored within a first preset number of detection periods is less than a preset number threshold.
[0140] In one embodiment of this application, if the forwarding chip receives a second notification carrying an identifier of the target protocol type, it directly resumes the rate at which it sends protocol messages of the target protocol type to the main control board. In this way, because the forwarding chip directly resumes the rate at which it sends protocol messages 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 messages in a timely manner.
[0141] As can be seen from the above embodiments, in this application embodiment, 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 the timely processing of protocol messages by the main control board CPU.
[0142] See Figure 6 This is a flowchart illustrating the fifth flow control method provided in this application embodiment. The method includes steps S601-S605, which are the same as those described above. Figure 4 Compared to the embodiment shown, steps S601-S602 are the same as steps S401-S402 above. After step S602, steps S603-S605 are also included.
[0143] S603, monitor the second number of protocol messages of the target protocol type that are lost within a second preset number of periods after receiving the first notification.
[0144] The values of the second preset quantity and the period can be set according to specific needs.
[0145] After receiving protocol messages from the outside, the forwarding chip also processes them using an enqueue method. Specifically, after receiving a protocol message, the forwarding chip writes the protocol message to the corresponding protocol channel based on the non-network layer protocol type of the message. If the processing capacity of the forwarding chip is exceeded, it will result in protocol channel congestion, and newly received protocol messages will fail to be written to the protocol channel, leading to packet loss.
[0146] In one embodiment of this application, after receiving a first notification of the target protocol type identifier, the forwarding chip can monitor the protocol channel corresponding to the target protocol type identifier on the forwarding chip, and monitor the second number of target protocol type protocol packets that have been lost on the protocol channel within a first preset number of periods. That is, after the forwarding chip adopts corresponding flow control measures for the target protocol type protocol packets, it counts the number of lost target protocol type protocol packets on the forwarding chip according to the period.
[0147] S604, if a second notification carrying an identifier of the target protocol type is received, monitor the third number of protocol messages of the target protocol type that have been lost within a third preset number of periods after the second notification is received.
[0148] The second notification is sent to the forwarding chip when the processor in the main control board monitors the first number of target protocol packets that have been lost within the detection period after the first notification is sent.
[0149] The values for the third preset quantity and the period can be set according to specific needs. The values for the second and third preset quantities can be the same or different.
[0150] In one embodiment of this 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 the second number of protocol packets of the target protocol type that have been lost on the protocol channel within a second preset number of periods. That is, after receiving the instruction from the main control board to restore the transmission rate of protocol packets of the target protocol type, the forwarding chip counts the number of lost protocol packets of the target protocol type on the forwarding chip according to the period.
[0151] S605, if the decrease in the third quantity relative to the second quantity is proportional to the second quantity, then the rate of sending protocol messages of the target protocol type to the main control board is restored.
[0152] The aforementioned preset ratio can be expressed as a percentage or 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%, meaning that when the decrease in the third quantity relative to the second quantity reaches 50% of the second quantity, the forwarding chip can resume sending protocol messages of the target protocol type to the main control board CPU. Assuming the second quantity is 10, when the third quantity is 5, the decrease in the third quantity relative to the second quantity is 5, and the ratio of the decrease in the third quantity relative to the second quantity to the second quantity is 50%, reaching the preset ratio (50%), so the forwarding chip can resume sending protocol messages of the target protocol type to the main control board CPU. Similarly, when the third quantity is 4, the decrease in the third quantity relative to the second quantity is 6, and the ratio of the decrease in the third quantity relative to the second quantity to the second quantity is 60%, also reaching the preset ratio (50%), so the forwarding chip can resume sending protocol messages of the target protocol type to the main control board CPU.
[0153] In one embodiment of this application, the second quantity can be understood as the number of packet losses of the target protocol type protocol packets on the forwarding chip within a certain period of time after the forwarding chip adopts corresponding flow control measures for the target protocol type protocol packets. The third quantity can be understood as the number of packet losses of the target protocol type protocol packets on the forwarding chip within a certain period of time after the forwarding chip receives the instruction from the main control board CPU to restore the sending rate of the target protocol type protocol packets. The forwarding chip then determines whether the decrease in the third quantity relative to the second quantity and the ratio of the third quantity to the second quantity reaches a preset ratio. If the preset ratio is reached, it indicates that the packet loss situation of the target protocol type protocol packets on the forwarding chip has improved within a certain period of time after receiving the instruction from the main control board CPU to restore the sending rate of the target protocol type protocol packets. This reduces the possibility of a large number of sudden target protocol type protocol packets flooding into the same receiving channel of the main control board CPU in a short period of time. It can also be understood as the number of protocol packets sent by external network attackers received by the forwarding chip has decreased or even disappeared, the network attack has ended, and therefore the forwarding chip can restore the rate of sending target protocol type protocol packets to the main control board CPU.
[0154] As can be seen from the above embodiments, in this embodiment of the application, the forwarding chip of the line card board in the distributed device monitors the number of packet loss of the target protocol type protocol messages on the forwarding chip within a certain period of time after the forwarding chip adopts the corresponding flow control measures for the target protocol type protocol messages, i.e., the second number, and the number of packet loss of the target protocol type protocol messages on the forwarding chip within a certain period of time after the forwarding chip receives the instruction from the main control board CPU to restore the sending rate of the target protocol type protocol messages, i.e., the third number. By judging whether the decrease of the third number relative to the second number and the ratio of the second number have reached a preset ratio, it is determined whether the packet loss situation of the target protocol type protocol messages on the forwarding chip has been improved. That is, the judgment condition for the forwarding chip to restore the sending rate of the target protocol type protocol messages 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.
[0155] Based on the same inventive concept, this application also provides a main control board, see [link to relevant documentation]. Figure 7 This is a schematic diagram of a main control board provided in an embodiment of this 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:
[0156] The first protocol message that was lost in the previous detection period is identified; wherein, the first protocol message is sent from the forwarding chip in the line card board of the distributed device to the processor in the main control board;
[0157] Identify the target protocol message that has the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, wherein the source line card identifier carried by the protocol message indicates the line card that sent 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.
[0158] A first 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 reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board. The target line card is the line card corresponding to the source line card 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.
[0159] In one embodiment of this application, after sending a first notification carrying an identifier of the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board, the processor 701 in the main control board is further configured to perform the following steps:
[0160] The first number of target protocol packets that are lost within the detection period after the first notification is sent;
[0161] If the first number detected within a first preset number of 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 board 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.
[0162] In one embodiment of this application, the processor in the main control board is specifically used to perform the following steps:
[0163] Record the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the protocol type identifier;
[0164] Based on the correspondence, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier is determined.
[0165] Based on the same inventive concept, this application provides a line card board, see [link to relevant documentation]. Figure 8 This is a schematic diagram of the structure of a line card provided in an embodiment of this application. Figure 8 The diagram of the line card board structure only shows the forwarding chip 801. The line card board can be any line card board in a distributed device. The forwarding chip 801 in the line card board performs the following steps:
[0166] A protocol message is sent to the processor in the main control board of the distributed device. The protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message.
[0167] If a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained.
[0168] The target protocol type is determined by the processor in the main control board, which identifies the protocol type carried by the protocol type identifier in the first protocol message that was lost in the previous detection cycle. The target protocol message is the protocol message that carries the same source line card identifier and protocol type identifier among the most numerous first protocol messages.
[0169] In one embodiment of this application, the forwarding chip 801 in the line card board is specifically used to perform the following steps:
[0170] If the target protocol type is a specified protocol type, maintain the rate at which protocol messages of the target protocol type are sent 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.
[0171] If the target protocol type is a non-specified protocol type, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
[0172] In one embodiment of this application, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured to perform the following steps:
[0173] 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. The second notification is sent by the processor in the main control board to the forwarding chip when the first number of target protocol messages lost within a detection period after the first notification is sent is less than a preset number threshold.
[0174] In one embodiment of this application, after reducing or maintaining the rate at which target protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured to perform the following steps:
[0175] The 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 is monitored.
[0176] If a second notification carrying an identifier of the target protocol type is received, the third number of target protocol type protocol messages that have been lost within a third preset number of periods after receiving the second notification is monitored. The second notification is sent to the forwarding chip by the processor in the main control board when it monitors the first number of target protocol messages that have been lost within a detection period after sending the first notification.
[0177] If the decrease in the third quantity relative to the second quantity is proportional to the second quantity, the rate of sending protocol messages of the target protocol type to the processor in the main control board is restored.
[0178] This application also provides an electronic device, such as... Figure 9 As shown, it includes a main control board 901 and at least one line card board 902. Figure 9The number of line card 902 shown is 1, the main control board is the main control board described in any of the above embodiments, and the line card is the line card described in any of the above embodiments.
[0179] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor in a main control board, implements any of the above-described flow control methods applied to the processor in a main control board of a distributed device.
[0180] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by the forwarding chip in the line card board, it implements any of the above-mentioned flow control methods for the forwarding chip in the line card board applied to distributed devices.
[0181] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the flow control methods described above.
[0182] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as 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, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0183] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0184] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the main control board embodiments, line card embodiments, electronic device embodiments, and computer storage medium embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0185] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A flow control method, characterized in that, A processor used in a main control board of a distributed device, the method comprising: The first protocol message that was lost in the previous detection period is identified; wherein, the first protocol message is sent from the forwarding chip in the line card board of the distributed device to the processor in the main control board; Identify the target protocol message that has the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, wherein the source line card identifier carried by the protocol message indicates the line card that sent 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 the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board. The target line card is the line card corresponding to the source line card 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 the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board, the method further includes: The first number of target protocol packets that are lost within the detection period after the first notification is sent; If the first number detected within a first preset number of 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 determination of the target protocol message with the largest number among the first protocol messages carrying the same source card identifier and protocol type identifier includes: Record the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the protocol type identifier; Based on the correspondence, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier is determined.
4. A flow control method, characterized in that, The method includes: a forwarding chip applied in any line card of a distributed device; A protocol message is sent to the processor in the main control board of the distributed device. The protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message. If a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained. The target protocol type is determined by the processor in the main control board, which identifies the protocol type carried by the protocol type identifier in the first protocol message that was lost in the previous detection cycle. The target protocol message is the protocol message that carries the same source line card identifier and protocol type identifier among the most numerous first protocol messages.
5. The method according to claim 4, characterized in that, The reduction or maintenance of the rate at which protocol messages of the target protocol type are sent to the processor in the main control board includes: If the target protocol type is a specified protocol type, maintain the rate at which protocol messages of the target protocol type are sent 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, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
6. The method according to claim 4, characterized in that, After reducing or maintaining the rate at which protocol messages of the target protocol type are sent 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. The second notification is sent by the processor in the main control board to the forwarding chip when the first number of target protocol messages lost within a detection period after the first notification is sent is less than a preset number threshold.
7. The method of claim 4, further comprising, after reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board: The 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 is monitored. If a second notification carrying an identifier of the target protocol type is received, the third number of target protocol type protocol messages that have been lost within a third preset number of periods after receiving the second notification is monitored. The second notification is sent to the forwarding chip by the processor in the main control board when it monitors the first number of target protocol messages that have been lost within a detection period after sending the first notification. If the decrease in the third quantity relative to the second quantity is proportional to the second quantity, 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: The first protocol message that was lost in the previous detection period is identified; wherein, the first protocol message is sent from the forwarding chip in the line card board of the distributed device to the processor in the main control board; Identify the target protocol message that has the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier, wherein the source line card identifier carried by the protocol message indicates the line card that sent 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 the target protocol type is sent to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages of the target protocol type to the processor in the main control board. The target line card is the line card corresponding to the source line card 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 the target protocol type to the forwarding chip of the target line card to instruct the forwarding chip to reduce the rate at which it sends protocol messages 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: The first number of target protocol packets that are lost within the detection period after the first notification is sent; If the first number detected within a first preset number of 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: Record the correspondence between the source line card identifier and the protocol type identifier and the number of first protocol messages carrying the same source line card identifier and the protocol type identifier; Based on the correspondence, the target protocol message with the largest number of first protocol messages carrying the same source line card identifier and protocol type identifier is determined.
11. A wire card board, characterized in that, The line card can be any line card in a distributed device, and the forwarding chip in the line card performs the following steps: A protocol message is sent to the processor in the main control board of the distributed device. The protocol message carries a source line card identifier and a protocol type identifier. The source line card identifier indicates the line card that sent the protocol message, and the protocol type identifier indicates the non-network layer protocol type corresponding to the protocol message. If a first notification carrying an identifier of the target protocol type is received from the processor in the main control board, the rate at which protocol messages of the target protocol type are sent to the processor in the main control board is reduced or maintained. The target protocol type is determined by the processor in the main control board, which identifies the protocol type carried by the protocol type identifier in the first protocol message that was lost in the previous detection cycle. The target protocol message is the protocol message that carries the same source line card identifier and protocol type identifier among the most numerous first protocol messages.
12. The line card plate according to claim 11, characterized in that, The forwarding chip in the line card is specifically used to perform the following steps: If the target protocol type is a specified protocol type, maintain the rate at which protocol messages of the target protocol type are sent 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, reduce the rate at which protocol messages of the target protocol type are sent to the processor in the main control board.
13. The line card plate according to claim 11, characterized in that, After reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured 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. The second notification is sent by the processor in the main control board to the forwarding chip when the first number of target protocol messages lost within a detection period after the first notification is sent is less than a preset number threshold.
14. The line card plate according to claim 11, characterized in that, After reducing or maintaining the rate at which protocol messages of the target protocol type are sent to the processor in the main control board, the forwarding chip in the line card board is further configured to perform the following steps: The 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 is monitored. If a second notification carrying an identifier of the target protocol type is received, the third number of target protocol type protocol messages that have been lost within a third preset number of periods after receiving the second notification is monitored. The second notification is sent to the forwarding chip by the processor in the main control board when it monitors the first number of target protocol messages that have been lost within a detection period after sending the first notification. If the decrease in the third quantity relative to the second quantity is proportional to the second quantity, 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 includes a main control board and at least one line card board, wherein the main control board is the main control board according to any one of claims 8-10, and the line card board is the line card board according to any one of claims 11-14.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor in the main control board, implements the steps of the method described in any one of claims 1-3.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by the forwarding chip in the line card board, implements the steps of the method described in any one of claims 4-7.
Citation Information
Patent Citations
Message processing method, device and system
CN104104592A
Method for controlling protocol message attack
CN1677933A