Message processing method and device and related equipment
By building table entries in the switching device, counting the packet delay and packet loss rate, and adjusting the speed limit threshold, the packet loss and delay problems caused by queue cache congestion in the switch are solved, and the proportion of packet upload to the CPU is optimized, and network performance is improved.
Patent Information
- Application Number
- CN202510457336.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-29
AI Technical Summary
In high-performance computing and AI artificial intelligence scenarios, RoCEv2 packets experience instantaneous burst congestion in the internal queue cache of the switch, resulting in increased packet loss and delay, affecting the performance of distributed applications.
By building table items in the switching device, counting the message delay and packet loss rate, determining the delay level based on the low delay waterline and high delay waterline, and adjusting the rate limit threshold ratio of the packet transmission to the CPU according to the packet loss rate, and optimizing the rate of packet transmission to the CPU.
Dynamically optimize the speed limit threshold, reduce the impact of switch performance limitation on delay, continuously optimize the proportion of CPUs sent to messages, and improve network performance.
Smart Images

Figure CN120389983A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network communication technologies, and particularly to a method and apparatus for processing packets and related devices. Background Art
[0002] RoCEv2 is a three-layer network protocol that allows remote direct memory access over Ethernet and is widely used in TCP / IP scenarios such as high-performance computing, distributed storage, and AI artificial intelligence to reduce CPU processing and latency and improve application performance. However, in this scenario, when multiple nodes send packets to one node, it may cause instantaneous burst congestion or even packet loss in the internal queue cache of the switch, resulting in an increase in application latency and thus damaging the performance of distributed applications. Summary of the Invention
[0003] This application provides a method and apparatus for processing packets and related devices.
[0004] In a first aspect, this application provides a method for processing packets, which is applied to a switching device. The switching device constructs corresponding entries based on the source QP and destination QP of each RoCEv2 packet. The method includes:
[0005] During the first sub-cycle of the current full upload cycle, count the packet delay and packet loss rate of the traffic packets corresponding to each entry.
[0006] Based on a preset low-delay waterline and high-delay waterline, determine the delay level of the traffic packets corresponding to each entry.
[0007] Based on the packet loss rate of the traffic packets corresponding to each entry included in each delay level, adjust the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value, so that the switching device uploads each traffic packet to the CPU based on the packet upload speed limit threshold of each traffic packet included in each delay level during other sub-cycles except the first sub-cycle.
[0008] Optionally, the step of determining the delay level of the traffic packets corresponding to each entry based on a preset low-delay waterline and high-delay waterline includes:
[0009] If the delay of the traffic packets corresponding to an entry is less than or equal to the low-delay waterline, determine that the delay level of the traffic packets corresponding to the entry is low.
[0010] If the delay of the traffic packets corresponding to an entry is greater than the low-delay waterline and less than the high-delay waterline, determine that the delay level of the traffic packets corresponding to the entry is medium.
[0011] If the delay of a traffic packet corresponding to a table entry is greater than or equal to the high-delay waterline, determine that the delay level of the traffic packet corresponding to the table entry is high.
[0012] Optionally, the step of adjusting the proportion of the packet forwarding rate limit threshold of each traffic packet included in each delay level to the entire protocol rate limit value based on the packet loss rate of the traffic packets corresponding to the table entries included in each delay level includes:
[0013] If the packet loss rate of the traffic packets with a low delay level is less than the first threshold, lower the proportion of the current packet forwarding rate limit threshold of the traffic packets corresponding to the table entries with a low delay level to the entire protocol rate limit value by a preset value;
[0014] If the packet loss rate of the traffic packets with a medium delay level is greater than or equal to the second threshold, increase the proportion of the current packet forwarding rate limit threshold of the traffic packets corresponding to the table entries with a low delay level to the entire protocol rate limit value by a preset value, where the first threshold is less than the second threshold.
[0015] Optionally, if the current full forwarding cycle is the first full forwarding cycle, the proportion of the current packet forwarding rate limit threshold of each traffic packet corresponding to each delay level in the first sub-cycle of the current full forwarding cycle to the entire protocol rate limit value is a preset initial value;
[0016] If the current full forwarding cycle is not the first full forwarding cycle, the proportion of the current packet forwarding rate limit threshold of each traffic packet corresponding to each delay level in the first sub-cycle of the current full forwarding cycle to the entire protocol rate limit value is calculated based on the number of table entries corresponding to each delay level counted in the previous full forwarding cycle and the preset coefficients configured for each delay level.
[0017] Optionally, the method further includes:
[0018] At the end of the current full forwarding cycle, calculate the total number of table entries corresponding to each delay level;
[0019] For each delay level, take the product of the total number of table entries corresponding to the delay level and the preset coefficient for the delay level as the delay coefficient of the delay level;
[0020] Based on the delay coefficients corresponding to each delay level, calculate the proportion of the packet forwarding rate limit threshold of each traffic packet included in each delay level in the next full forwarding cycle to the entire protocol rate limit value.
[0021] Optionally, the step of calculating the proportion of the packet forwarding rate limit threshold of each traffic packet included in each delay level in the next full forwarding cycle to the entire protocol rate limit value based on the delay coefficients corresponding to each delay level includes:
[0022] Calculate the weight value of each traffic message included in each delay level in the next full upload cycle according to the delay coefficient of the current full upload cycle, the average upload rate and the average packet loss rate of each traffic message included in each delay level, as well as the delay coefficient of the previous full upload cycle, the average upload rate and the average packet loss rate of each traffic message included in each delay level;
[0023] Normalize the weight value of each traffic message included in each delay level in the next full upload cycle to obtain the proportion of the message upload speed limit threshold of each traffic message included in each delay level to the entire protocol speed limit value.
[0024] Optionally, in the first sub-cycle of the next cycle, the switching device uploads each traffic message to the CPU based on the calculated message upload speed limit threshold of each traffic message included in each delay level.
[0025] In a second aspect, the present application provides a message processing device, which is applied to a switching device, and the switching device constructs corresponding table entries based on the source QP and destination QP of each RoCEv2 message; the device includes:
[0026] A statistics unit, configured to statistically calculate the message delay and packet loss rate of each traffic message corresponding to each table entry in the first sub-cycle of the current full upload cycle;
[0027] A determination unit, configured to determine the delay level of each traffic message corresponding to each table entry based on a preset low delay waterline and high delay waterline;
[0028] An adjustment unit, configured to adjust the proportion of the message upload speed limit threshold of each traffic message included in each delay level to the entire protocol speed limit value based on the message packet loss rate of each traffic message corresponding to each table entry included in each delay level;
[0029] An upload unit, configured to upload each traffic message to the CPU based on the message upload speed limit threshold of each traffic message included in each delay level in other sub-cycles except the first sub-cycle.
[0030] Optionally, when determining the delay level of each traffic message corresponding to each table entry based on a preset low delay waterline and high delay waterline, the determination unit is specifically configured to:
[0031] If the delay of a traffic message corresponding to a table entry is less than or equal to the low delay waterline, it is determined that the delay level of the traffic message corresponding to the table entry is low;
[0032] If the delay of a traffic message corresponding to a table entry is greater than the low delay waterline and less than the high delay waterline, it is determined that the delay level of the traffic message corresponding to the table entry is medium;
[0033] If the latency of a traffic packet corresponding to an entry is greater than or equal to the high latency waterline, determine that the latency level of the traffic packet corresponding to the entry is high.
[0034] Optionally, when adjusting the proportion of the packet upload rate limit threshold of each traffic packet included in each latency level to the entire protocol rate limit value based on the packet loss rate of the traffic packets corresponding to the entries included in each latency level, the adjustment unit is specifically configured to:
[0035] If the packet loss rate of the traffic packets with a low latency level is less than the first threshold, lower the proportion of the current upload rate limit threshold of the traffic packets corresponding to the entries with a low latency level in the first sub-period of the current full upload period to the entire protocol rate limit value by a preset value;
[0036] If the packet loss rate of the traffic packets with a medium latency level is greater than or equal to the second threshold, increase the proportion of the current upload rate limit threshold of the traffic packets corresponding to the entries with a low latency level in the first sub-period of the current full upload period to the entire protocol rate limit value by a preset value, where the first threshold is less than the second threshold.
[0037] Optionally, if the current full upload period is the first full upload period, the proportion of the current upload rate limit threshold of each traffic packet corresponding to each latency level to the entire protocol rate limit value is a preset initial value;
[0038] If the current full upload period is not the first full upload period, the proportion of the current upload rate limit threshold of each traffic packet corresponding to each latency level to the entire protocol rate limit value is calculated based on the number of entries corresponding to each latency level counted in the previous full upload period and the preset coefficients configured for each latency level.
[0039] Optionally, the device further includes a calculation unit:
[0040] The calculation unit is specifically configured to, at the end of the current full upload period, calculate the total number of entries corresponding to each latency level; for each latency level, use the product of the total number of entries corresponding to the latency level and the preset coefficient for the latency level as the latency coefficient for the latency level; based on the latency coefficients corresponding to each latency level, calculate the proportion of the packet upload rate limit threshold of each traffic packet included in each latency level to the entire protocol rate limit value in the next full upload period.
[0041] Optionally, when calculating the proportion of the packet upload rate limit threshold of each traffic packet included in each latency level to the entire protocol rate limit value in the next full upload period based on the latency coefficients corresponding to each latency level, the calculation unit is specifically configured to:
[0042] Calculate the weight value of each traffic packet included in each delay level in the next full upload cycle based on the delay coefficient of the current full upload cycle, the average upload rate and the average packet loss rate of each traffic packet included in each delay level, and the delay coefficient of the previous full upload cycle, the average upload rate and the average packet loss rate of each traffic packet included in each delay level;
[0043] Normalize the weight value of each traffic packet included in each delay level in the next full upload cycle to obtain the ratio of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value.
[0044] Optionally, in the first sub-cycle of the next cycle, the switching device uploads each traffic packet to the CPU based on the calculated packet upload speed limit threshold of each traffic packet included in each delay level.
[0045] In a third aspect, an embodiment of the present application provides a packet processing device, which includes:
[0046] A memory for storing program instructions;
[0047] A processor for calling the program instructions stored in the memory and executing the steps of the method described in any one of the first aspects above according to the obtained program instructions.
[0048] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions for causing the computer to execute the steps of the method described in any one of the first aspects above.
[0049] In summary, the packet processing method provided by the embodiment of the present application is applied to a switching device, and the switching device constructs corresponding table entries based on the source QP and destination QP of each RoCEv2 packet; the method includes: in the first sub-cycle of the current full upload cycle, counting the packet delay and packet loss rate of each traffic packet corresponding to each table entry; determining the delay level of each traffic packet corresponding to each table entry based on a preset low delay waterline and high delay waterline; adjusting the ratio of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value based on the packet loss rate of each traffic packet included in each delay level; in other sub-cycles except the first sub-cycle, uploading each traffic packet to the CPU based on the packet upload speed limit threshold of each traffic packet included in each delay level.
[0050] By using the packet processing method provided in the embodiments of the present application, the rate limiting threshold of this period is repeatedly and dynamically optimized through self-learning according to parameters such as the latency, upload rate, and packet loss rate of the entries corresponding to each RoCEv2 packet in this period, and the upload ratio of each packet in the next period is adjusted according to the latency optimization result of this period, so as to adapt to the changing RoCEv2 network, continuously optimize the proportion of RoCEv2 packets uploaded to the CPU, and reduce the impact on latency calculation due to the performance limitation of the switch. Description of the Drawings
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments of the present application or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present application. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings of the embodiments of the present application.
[0052] Figure 1 It is a detailed flowchart of a packet processing method provided in the embodiments of the present application;
[0053] Figure 2 It is a flowchart of an algorithm for dynamically adjusting the rate limiting threshold provided in the embodiments of the present application;
[0054] Figure 3 It is a schematic structural diagram of a packet processing device provided in the embodiments of the present application;
[0055] Figure 4 It is a schematic hardware architecture diagram of a packet processing device provided in the embodiments of the present application. Detailed Embodiments
[0056] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and do not limit the present application. The singular forms of "a", "the", and "said" used in the present application and the claims are also intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to any or all possible combinations including one or more of the associated listed items.
[0057] It should be understood that although the terms first, second, third, etc. may be used in the embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "when" or "while" or "in response to a determination".
[0058] Currently, when RoCEv2 packets pass through a switch, in order to analyze characteristics such as the latency of the packets, the packets need to be sent to the CPU. Specifically, the following technology is used to send the packets to the CPU:
[0059] The driver sends all RoCEv2 packets that match the protocol ACL to the platform through the same queue. After the platform receives the paired packets, it creates entries respectively according to packet characteristics such as SIP (Source IP), DIP (Destination IP), SQP (Source QueuePair), and DQP (Destination QP).
[0060] Start a timer with a period of 10.5 seconds. In the first 10 seconds, all Operandack type ACLs remain in the inactive state (sampling upload stage). Packets that match the Oper type ACL are sampled and sent to the platform for throughput calculation. After 10 seconds, the timer flushes all Operandack type ACLs to the active state and keeps them for 500 milliseconds (full upload stage). Packets that match the Operandack type ACL continue to calculate latency, and packets that match the Oper type ACL calculate throughput. After the 500 - millisecond timer ends, all active Operandack type ACLs are flushed to the inactive state, and enter the next timer cycle.
[0061] However, when the switch sends packets to the CPU, during the full upload stage, it is prone to packet loss due to congestion and rate limiting, resulting in a large latency problem. Without differentiating between packets with different latencies and packet loss rates, but fixing an upload rate - limiting threshold, it will cause some packets to be continuously lost and the latency cannot be calculated / calculated inaccurately, which cannot meet the user's requirements.
[0062] Exemplarily, refer to Figure 1 As shown, it is a detailed flowchart of a packet processing method provided by an embodiment of the present application. This method is applied to a switching device. The switching device constructs corresponding entries based on the source QP and destination QP of each RoCEv2 packet. The method includes the following steps:
[0063] Step 100: In the first sub - cycle of the current full upload period, statistically calculate the packet latency and packet loss rate of the traffic packets corresponding to each entry.
[0064] In practical applications, the switching device can create corresponding entries based on the source QP (QueuePairs) and destination QP during the process of establishing a session between the source end and the destination end.
[0065] Specifically, in the first sub - cycle of the first full - volume upload period (e.g., the first 100 ms of a 500 - ms full - volume upload period) of the switching device, according to the packets for full - volume upload within the first sub - cycle (e.g., RoCEv2 packets), the packet delay and packet loss rate of the traffic packets corresponding to each table entry are statistically calculated.
[0066] Step 110: Based on a preset low - delay waterline and high - delay waterline, determine the delay level of the traffic packets corresponding to each table entry.
[0067] In the embodiments of the present application, new parameters of the low - delay waterline and high - delay waterline are added. For example, the default low - delay waterline parameter is 200 ms, and the high - delay waterline parameter is 400 ms. Based on the calculated packet delay of the traffic packets corresponding to each table entry, determine the delay level of the traffic packets corresponding to each table entry.
[0068] Specifically, in the embodiments of the present application, when determining the delay level of the traffic packets corresponding to each table entry based on the preset low - delay waterline and high - delay waterline, a preferred implementation method is as follows:
[0069] If the delay of the traffic packets corresponding to a table entry is less than or equal to the low - delay waterline, determine that the delay level of the traffic packets corresponding to this table entry is low;
[0070] If the delay of the traffic packets corresponding to a table entry is greater than the low - delay waterline and less than the high - delay waterline, determine that the delay level of the traffic packets corresponding to this table entry is medium;
[0071] If the delay of the traffic packets corresponding to a table entry is greater than or equal to the high - delay waterline, determine that the delay level of the traffic packets corresponding to this table entry is high.
[0072] That is to say, if the delay of the traffic packet 1 corresponding to table entry 1 is less than or equal to 200 ms, determine that the delay level of the traffic packet 1 corresponding to table entry 1 is low.
[0073] If the delay of the traffic packet 2 corresponding to table entry 2 is greater than 200 ms and less than 400 ms, determine that the delay level of the traffic packet 2 corresponding to table entry 2 is medium.
[0074] If the delay of the traffic packet 3 corresponding to table entry 3 is greater than or equal to 400 ms, determine that the delay level of the traffic packet 3 corresponding to table entry 3 is high.
[0075] Step 120: Based on the packet loss rate of the traffic packets corresponding to each table entry included in each delay level, adjust the proportion of the packet upload speed - limit threshold of each traffic packet included in each delay level to the entire protocol speed - limit value.
[0076] In the embodiments of the present application, for each traffic packet included in each delay level, there is a set proportion of the initial packet upload speed - limit threshold to the entire protocol speed - limit value.
[0077] For example, the proportion of the initial packet upload speed limit threshold set for each traffic packet with a low delay level to the entire protocol speed limit value is 10% (all traffic packets with a low delay level share this 10% proportion); the proportion of the initial packet upload speed limit threshold set for each traffic packet with a medium delay level to the entire protocol speed limit value is 20% (all traffic packets with a medium delay level share this 20% proportion); the proportion of the initial packet upload speed limit threshold set for each traffic packet with a high delay level to the entire protocol speed limit value is 70% (all traffic packets with a high delay level share this 70% proportion).
[0078] Statistically analyze the packet loss rate of each traffic packet included in each delay level. For example, statistically analyze the packet loss rate of all traffic packets with a low / medium delay level, and determine whether to adjust the proportion of the upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value according to the packet loss rate.
[0079] Specifically, when adjusting the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value based on the packet loss rate of the traffic packets corresponding to each entry included in each delay level, a preferred implementation method is as follows:
[0080] If the packet loss rate of each traffic packet with a low delay level is less than the first threshold, then lower the proportion of the current upload speed limit threshold of the traffic packets corresponding to each entry with a low delay level to the entire protocol speed limit value by a preset value.
[0081] For example, for each traffic packet with a low delay level, statistically analyze the packet loss rate of each traffic packet. If it is determined that the packet loss rate is less than 20%, then lower the proportion of the current upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value by 1%. Specifically, the packet loss rate of each traffic packet with a low delay level can be calculated once in each sub-period except the first sub-period, and the proportion of the current upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value can be adjusted once. A preferred implementation method is that there is a minimum value (such as 5%) for the proportion of the current upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value. That is, the adjusted proportion of the current upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value is not less than 5%.
[0082] If the packet loss rate of each traffic packet with a medium delay level is greater than or equal to the second threshold, then raise the proportion of the current upload speed limit threshold of the traffic packets corresponding to each entry with a low delay level to the entire protocol speed limit value by a preset value, where the first threshold is less than the second threshold.
[0083] For example, for each traffic packet with a medium delay level, the packet loss rate of each traffic packet is statistically calculated. If it is determined that the packet loss rate is greater than or equal to 10%, the ratio of the current upload speed limit threshold of each traffic packet with a medium delay level to the entire protocol speed limit value is increased by 1%. Specifically, the packet loss rate of each traffic packet with a medium delay level can be calculated once in each sub - cycle except the first sub - cycle, and the ratio of the current upload speed limit threshold of each traffic packet with a medium delay level to the entire protocol speed limit value is adjusted once. A preferred implementation is that there is a maximum value (e.g., 25%) for the ratio of the current upload speed limit threshold of each traffic packet with a medium delay level to the entire protocol speed limit value. That is, the ratio of the current upload speed limit threshold of each traffic packet with a medium delay level after adjustment to the entire protocol speed limit value is not greater than 25%.
[0084] Take the ratio of the remaining upload speed limit threshold to the entire protocol speed limit value, excluding the ratio of the current upload speed limit threshold of each traffic packet with a low delay level to the entire protocol speed limit value and the ratio of the current upload speed limit threshold of each traffic packet with a medium delay level to the entire protocol speed limit value, as the ratio of the current upload speed limit threshold of each traffic packet with a high delay level to the entire protocol speed limit value.
[0085] Step 130: In other sub - cycles except the first sub - cycle, upload each traffic packet to the CPU based on the packet upload speed limit threshold of each traffic packet included in each delay level.
[0086] In the embodiment of the present application, if the current full - volume upload cycle is the first full - volume upload cycle, the ratio of the current upload speed limit threshold of each traffic packet corresponding to each delay level to the entire protocol speed limit value in the first sub - cycle of the current full - volume upload cycle is a preset initial value.
[0087] For example, the preset initial ratio set for each traffic packet with a low delay level is 10%; the preset initial ratio set for each traffic packet with a medium delay level is 20%; the preset initial ratio set for each traffic packet with a high delay level is 70%.
[0088] If the current full - volume upload cycle is not the first full - volume upload cycle, the ratio of the current upload speed limit threshold of each traffic packet corresponding to each delay level to the entire protocol speed limit value in the first sub - cycle of the current full - volume upload cycle is calculated based on the number of table entries corresponding to each delay level statistically obtained in the previous full - volume upload cycle and the preset coefficients pre - configured for each delay level.
[0089] Specifically, in the embodiment of the present application, the above - mentioned packet processing method may further include the following steps:
[0090] At the end of the current full upload period, calculate the total number of entries corresponding to each delay level; for each delay level, use the product of the total number of entries corresponding to the delay level and a preset coefficient for the delay level as the delay coefficient for the delay level; based on the delay coefficients corresponding to each delay level, calculate the proportion of the message upload speed limit threshold of each traffic message included in each delay level in the next full upload period to the entire protocol speed limit value.
[0091] In an embodiment of the present application, when calculating, based on the delay coefficients corresponding to each delay level, the proportion of the message upload speed limit threshold of each traffic message included in each delay level in the next full upload period to the entire protocol speed limit value, a preferred implementation is as follows:
[0092] According to the delay coefficient of the current full upload period, the average upload rate and average packet loss rate of each traffic message included in each delay level, and the delay coefficient of the previous full upload period, the average upload rate and average packet loss rate of each traffic message included in each delay level, calculate the weight value of each traffic message included in each delay level in the next full upload period;
[0093] Perform normalization processing on the weight values of each traffic message included in each delay level in the next full upload period to obtain the proportion of the message upload speed limit threshold of each traffic message included in each delay level to the entire protocol speed limit value.
[0094] In this way, in the first sub-period of the next cycle, the switching device uploads each traffic message to the CPU based on the calculated message upload speed limit threshold of each traffic message included in each delay level.
[0095] The message processing method provided by the embodiment of the present application will be described in detail below in combination with a specific application scenario.
[0096] 1. The server injects paired RoCEv2 messages into the switch so that the switch establishes corresponding entries according to the source QP and destination QP of the messages;
[0097] 2. In the first 500 ms cycle (full upload period), the switch statistically calculates the message delay and packet loss rate of the messages corresponding to each entry once every 100 ms based on the messages uploaded in full volume for the first time;
[0098] 3. Add two delay waterline parameters to the switch: low delay waterline and high delay waterline. The default low delay waterline is 200 ms, and the high delay waterline is 400 ms. If the delay of a packet corresponding to a table entry is calculated to be between 0 and 200 ms, it is determined that the delay level of the packet corresponding to the table entry is low, and the speed limit value for the next upload within the current period of all characteristic packets at this delay level is set to 10% of the speed limit value of the entire RoCEv2 protocol (i.e., all packets corresponding to table entries with a low delay level share this 10%); if the delay of a packet corresponding to a table entry is calculated to be between 201 ms and 400 ms, it is determined that the delay level of the packet corresponding to the table entry is medium, and the speed limit value for the next upload within the current period of all characteristic packets at this delay level is set to 20% of the entire protocol speed limit value; if the delay of a packet corresponding to a table entry is calculated to be greater than 400 ms, it is determined that the delay level of the packet corresponding to the table entry is high, and the speed limit value for the next upload within the current period of all characteristic packets at this delay level is set to 70% of the entire protocol speed limit value. Exemplarily, refer to Table 1 as follows:
[0099]
[0100] Table 1 Delay Level and Initial Speed Limit Threshold
[0101] 4. Provide specific commands to the user to dynamically adjust the low delay waterline and high delay waterline. The user can repeatedly and dynamically adjust the high and low delay waterlines by viewing the calculated delay.
[0102] 5. Each table entry separately records its own delay statistics table, the delay level and speed limit threshold obtained in step 3, and the current packet loss rate.
[0103] 6. Dynamically adjust the proportion of the speed limit threshold in the entire protocol speed limit value through the following dynamic adjustment speed limit threshold algorithm. Exemplarily, refer to Figure 2 shown in the flowchart of the dynamic adjustment speed limit threshold algorithm provided by the embodiment of the present application:
[0104] (1) Obtain the delay statistics table recorded in step 5;
[0105] (2) Determine the delay level of the characteristic packet according to Table 1;
[0106] (3) 1. For characteristic packets with a low delay level, obtain the packet loss rate of the characteristic packet and determine whether the packet loss rate is less than 20%. When the packet loss rate is less than 20%, lower the speed limit threshold for this delay level. Each time it is judged, the speed limit threshold for this delay level is lowered by 1%, and the lowest speed limit threshold is 5% of the entire protocol packet speed limit value; when the packet loss rate is greater than or equal to 20%, do not adjust the speed limit threshold;
[0107] (3)2. For the characteristic packets in the medium delay level segment, obtain the packet loss rate corresponding to the characteristic packets, and determine whether the packet loss rate is less than 10%: When the packet loss rate is less than 10%, do not adjust the speed limit threshold; when the packet loss rate is greater than or equal to 10%, increase the speed limit threshold for this delay level by 1% each time it is judged, and the maximum speed limit threshold is 25% of the speed limit value of the entire protocol packet;
[0108] (3)3. For the characteristic packets with a high delay level, set the speed limit threshold for the packets at this delay level = the speed limit value of the entire protocol packet - the speed limit threshold of the low delay level - the speed limit threshold of the medium delay level, and enable the PFC and ECN functions for the packets with a high delay level;
[0109] 7. After the end of the 500 ms cycle of full upload, count the number of entries corresponding to each delay interval in Table 2, and calculate the delay coefficient of each characteristic packet in the next cycle according to the following formula:
[0110] Delay coefficient calculation method: Delay coefficient = the number of entries in each delay interval * coefficient;
[0111]
[0112] Table 2 Proportion coefficients of each delay interval
[0113] 8. According to the delay coefficients calculated in step 7, calculate the weight header W of various (low, medium, high) entry packets in the next 500 ms full upload cycle based on the following formula: W = [(delay coefficient calculated from the delay table in this cycle / (average upload rate in this cycle - average packet loss rate in this cycle)) - (delay coefficient calculated from the delay table in the previous cycle / (average upload rate in the previous cycle - average packet loss rate in the previous cycle))] * preset coefficient;
[0114] In the embodiment of the present application, the calculation result of step 8 is used as the weight values of the speed limit thresholds for the packets corresponding to each delay level in the first 100 ms of the next 500 ms, w1 (weight value of the packets corresponding to the low delay level), w2 (weight value of the packets corresponding to the medium delay level), and w3 (weight value of the packets corresponding to the high delay level).
[0115] Perform normalization processing on w1, w2, and w3 to obtain the proportion of the packets corresponding to each delay level in the first 100 ms of the next 500 ms to the entire protocol speed limit value as shown in Table 3.
[0116]
[0117] Table 3
[0118] Further, the reporting of the second 100 ms of the next 500 ms is adjusted based on the statistical result of the first 100 ms.
[0119] Among them, a specific command is provided to the user to dynamically adjust the preset coefficient, and the default preset coefficient is 50%;
[0120] 9. Add a weight header W to the packets of the next cycle. In the first 100 ms of the current 500 ms, the control plane reports packets according to the proportion of the weight headers of each packet.
[0121] Exemplarily, refer to Figure 3 As shown, it is a schematic structural diagram of a packet processing device provided by an embodiment of the present application. The device is applied to a switching device, and the switching device constructs corresponding entries based on the source QP and destination QP of each RoCEv2 packet; the device includes:
[0122] A statistics unit, configured to statistically calculate the packet delay and packet loss rate of the traffic packets corresponding to each entry in the first sub-cycle of the current full reporting cycle;
[0123] A determination unit, configured to determine the delay level of the traffic packets corresponding to each entry based on a preset low-delay waterline and high-delay waterline;
[0124] An adjustment unit, configured to adjust the proportion of the packet reporting speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value based on the packet loss rate of the traffic packets corresponding to each entry included in each delay level;
[0125] A reporting unit, configured to report each traffic packet to the CPU based on the packet reporting speed limit threshold of each traffic packet included in each delay level in other sub-cycles except the first sub-cycle.
[0126] Optionally, when determining the delay level of the traffic packets corresponding to each entry based on a preset low-delay waterline and high-delay waterline, the determination unit is specifically configured to:
[0127] If the delay of the traffic packet corresponding to an entry is less than or equal to the low-delay waterline, it is determined that the delay level of the traffic packet corresponding to the entry is low;
[0128] If the delay of the traffic packet corresponding to an entry is greater than the low-delay waterline and less than the high-delay waterline, it is determined that the delay level of the traffic packet corresponding to the entry is medium;
[0129] If the delay of the traffic packet corresponding to an entry is greater than or equal to the high-delay waterline, it is determined that the delay level of the traffic packet corresponding to the entry is high.
[0130] Optionally, when adjusting the ratio of the packet forwarding rate limit threshold of each traffic packet included in each delay level to the entire protocol rate limit value based on the packet loss rate of the traffic packets corresponding to each entry included in each delay level, the adjustment unit is specifically configured to:
[0131] If the packet loss rate of the traffic packets with a low delay level is less than the first threshold, then reduce the ratio of the current packet forwarding rate limit threshold of the traffic packets corresponding to each entry with a low delay level in the first sub-period of the current full forwarding period to the entire protocol rate limit value by a preset value;
[0132] If the packet loss rate of the traffic packets with a medium delay level is greater than or equal to the second threshold, then increase the ratio of the current packet forwarding rate limit threshold of the traffic packets corresponding to each entry with a low delay level in the first sub-period of the current full forwarding period to the entire protocol rate limit value by a preset value, where the first threshold is less than the second threshold.
[0133] Optionally, if the current full forwarding period is the first full forwarding period, then the ratio of the current packet forwarding rate limit threshold of each traffic packet corresponding to each delay level to the entire protocol rate limit value is the preset initial value;
[0134] If the current full forwarding period is not the first full forwarding period, then the ratio of the current packet forwarding rate limit threshold of each traffic packet corresponding to each delay level to the entire protocol rate limit value is calculated based on the number of entries corresponding to each delay level statistically obtained in the previous full forwarding period and the preset coefficients configured for each delay level.
[0135] Optionally, the device further includes a calculation unit:
[0136] The calculation unit is specifically configured to, at the end of the current full forwarding period, calculate the total number of entries corresponding to each delay level; for each delay level, use the product of the total number of entries corresponding to the delay level and the preset coefficient for the delay level as the delay coefficient for the delay level; based on the delay coefficients corresponding to each delay level, calculate the ratio of the packet forwarding rate limit threshold of each traffic packet included in each delay level to the entire protocol rate limit value in the next full forwarding period.
[0137] Optionally, when calculating the ratio of the packet forwarding rate limit threshold of each traffic packet included in each delay level to the entire protocol rate limit value in the next full forwarding period based on the delay coefficients corresponding to each delay level, the calculation unit is specifically configured to:
[0138] Calculate the weight values of each traffic packet included in each delay level in the next full upload cycle based on the delay coefficient of the current full upload cycle, the average upload rate and the average packet loss rate of each traffic packet included in each delay level, as well as the delay coefficient of the previous full upload cycle, the average upload rate and the average packet loss rate of each traffic packet included in each delay level.
[0139] Normalize the weight values of each traffic packet included in each delay level in the next full upload cycle to obtain the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value.
[0140] Optionally, in the first sub-cycle of the next cycle, the switching device uploads each traffic packet to the CPU based on the calculated packet upload speed limit threshold of each traffic packet included in each delay level.
[0141] These units above can be one or more integrated circuits configured to implement the above method. For example: one or more Application Specific Integrated Circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more Field Programmable Gate Arrays (FPGAs), etc. Again, when a certain unit above is implemented in the form of a processing element scheduling program code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processors that can call program code. Again, these units can be integrated together to be implemented in the form of a system-on-a-chip (SOC).
[0142] Furthermore, for the packet processing device provided in the embodiments of the present application, from a hardware perspective, the schematic diagram of the hardware architecture of the packet processing device can be seen Figure 4 as shown. The packet processing device may include: a memory 40 and a processor 41.
[0143] The memory 40 is used to store program instructions; the processor 41 calls the program instructions stored in the memory 40 and executes the above method embodiments according to the obtained program instructions. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0144] Optionally, the present application also provides a switching device, including at least one processing element (or chip) for executing the above method embodiments.
[0145] Optionally, the present application also provides a program product, such as a computer-readable storage medium, which stores computer-executable instructions for causing a computer to execute the method embodiments described above.
[0146] Here, the machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, and so on. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0147] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media player, navigation device, email transceiver device, game console, tablet computer, wearable device, or a combination of any several of these devices.
[0148] For convenience of description, when describing the above devices, they are divided into various units according to functions and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0149] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, system, or computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0150] The present application is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate for implementing the process Figure 1One or more processes and / or blocks Figure 1 An apparatus for the functions specified in one or more blocks.
[0151] Furthermore, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device that implements the functions in the process Figure 1 One or more processes and / or blocks Figure 1 The functions specified in one or more blocks.
[0152] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are performed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 One or more processes and / or blocks Figure 1 The steps of the functions specified in one or more blocks.
[0153] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
Claims
1. A message processing method, characterized in that, Applied to a switching device, the switching device constructs corresponding table entries based on the source QP and destination QP of each RoCEv2 packet; the method includes: During the first sub-period of the current full upload cycle, count the packet delay and packet loss rate of the traffic packets corresponding to each table entry; Based on a preset low delay waterline and high delay waterline, determine the delay level of the traffic packets corresponding to each table entry; Based on the packet loss rate of the traffic packets corresponding to each table entry included in each delay level, adjust the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value; During other sub-periods except the first sub-period, upload each traffic packet to the CPU based on the packet upload speed limit threshold of each traffic packet included in each delay level.
2. The method according to claim 1, characterized in that The step of determining the delay level of the traffic packets corresponding to each table entry based on a preset low delay waterline and high delay waterline includes: If the delay of the traffic packet corresponding to a table entry is less than or equal to the low delay waterline, determine that the delay level of the traffic packet corresponding to this table entry is low; If the delay of the traffic packet corresponding to a table entry is greater than the low delay waterline and less than the high delay waterline, determine that the delay level of the traffic packet corresponding to this table entry is medium; If the delay of the traffic packet corresponding to a table entry is greater than or equal to the high delay waterline, determine that the delay level of the traffic packet corresponding to this table entry is high.
3. The method according to claim 2, wherein The step of adjusting the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level to the entire protocol speed limit value based on the packet loss rate of the traffic packets corresponding to each table entry included in each delay level includes: If the packet loss rate of the traffic packets with a low delay level is less than the first threshold, lower the proportion of the current upload speed limit threshold of the traffic packets corresponding to each table entry with a low delay level to the entire protocol speed limit value by a preset value; If the packet loss rate of the traffic packets with a medium delay level is greater than or equal to the second threshold, raise the proportion of the current upload speed limit threshold of the traffic packets corresponding to each table entry with a low delay level to the entire protocol speed limit value, where the first threshold is less than the second threshold.
4. The method according to any one of claims 1 to 3, characterized in that, If the current full upload cycle is the first full upload cycle, the proportion of the current upload speed limit threshold of each traffic packet corresponding to each delay level in the first sub-period of the current full upload cycle to the entire protocol speed limit value is a preset initial value; If the current full upload cycle is not the first full upload cycle, the proportion of the current upload speed limit threshold of each traffic packet corresponding to each delay level in the first sub-period of the current full upload cycle to the entire protocol speed limit value is calculated based on the number of table entries corresponding to each delay level counted in the previous full upload cycle and the preset coefficients configured for each delay level.
5. The method according to claim 4, wherein The method further includes: At the end of the current full upload cycle, calculate the total number of table entries corresponding to each delay level; For each delay level, use the product of the total number of table entries corresponding to this delay level and the preset coefficient for this delay level as the delay coefficient for this delay level; Based on the delay coefficients corresponding to each delay level, calculate the proportion of the packet upload speed limit threshold of each traffic packet included in each delay level in the next full upload cycle to the entire protocol speed limit value.
6. The method according to claim 5, wherein The steps of calculating, based on the delay coefficients corresponding to each delay level, the proportion of the message upload speed limit threshold of each traffic message included in each delay level in the entire protocol speed limit value within the next full upload cycle include: Calculating the weight value of each traffic message included in each delay level within the next full upload cycle according to the delay coefficient of the current full upload cycle, the average upload rate and the average packet loss rate of each traffic message included in each delay level, as well as the delay coefficient of the previous full upload cycle, the average upload rate and the average packet loss rate of each traffic message included in each delay level; Performing normalization processing on the weight values of each traffic message included in each delay level within the next full upload cycle to obtain the proportion of the message upload speed limit threshold of each traffic message included in each delay level in the entire protocol speed limit value.
7. The method according to claim 6, characterized in that In the first sub-cycle of the next cycle, the switching device uploads each traffic message to the CPU based on the calculated message upload speed limit threshold of each traffic message included in each delay level.
8. A message processing device, characterized in that, Applied to a switching device, the switching device constructs corresponding table entries based on the source QP and destination QP of each RoCEv2 message; the device includes: A statistics unit, configured to, in the first sub-cycle of the current full upload cycle, statistics the message delay and packet loss rate of each traffic message corresponding to each table entry; A determination unit, configured to determine the delay level of each traffic message corresponding to each table entry based on a preset low delay waterline and high delay waterline; An adjustment unit, configured to adjust the proportion of the message upload speed limit threshold of each traffic message included in each delay level in the entire protocol speed limit value based on the message packet loss rate of each traffic message corresponding to each table entry included in each delay level; An upload unit, configured to, in other sub-cycles except the first sub-cycle, upload each traffic message to the CPU based on the message upload speed limit threshold of each traffic message included in each delay level.
9. A message processing device, characterized in that, The message processing device includes: A memory, configured to store program instructions; A processor, configured to call the program instructions stored in the memory and execute the steps of the method according to any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause the computer to execute the steps of the method according to any one of claims 1-7.
Citation Information
Cited By
Upload rate control method of protocol message and electronic equipment
CN121644004A