ECN waterline adjustment method and device
The Q-table is trained through the reinforcement learning Q-Learning algorithm and the ECN waterline is dynamically adjusted, which solves the problem of difficulty in rationally adjusting the ECN waterline settings, improves network throughput performance, and achieves both delay and throughput.
Patent Information
- Application Number
- CN202210749818.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2042-06-28
AI Technical Summary
In the existing technology, the ECN waterline setting is difficult to adjust reasonably, making it difficult to balance queue delay and throughput performance indicators.
The reinforcement learning Q-Learning algorithm is used to train the Q table, the ECN waterline configuration is dynamically adjusted based on real-time aggregated statistical information, and the optimal ECN waterline is determined and processed through the agent.
It improves the rationality of ECN waterline configuration, improves network throughput performance indicators, and effectively alleviates delay and throughput conflicts in congestion control.
Smart Images

Figure CN115102905B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technology, and in particular to an ECN waterline adjustment method and device. Background Art
[0002] RDMA (Remote Direct Memory Access) is a technology that can solve the server-side data processing delay in network transmission. RDMA can quickly move data from one system to the remote system memory without any impact on the operating system. RDMA eliminates external memory copy and text exchange operations, thereby freeing up memory bandwidth and CPU (Center Process Unit) processing.
[0003] RoCE (RDMA over Converged Ethernet) is one of the mainstream RDMA technologies. In a RoCE network, a lossless Ethernet needs to be built to ensure that there is no packet loss during network transmission. The key features that need to be supported for building a lossless Ethernet include PFC (Priority-based Flow Control) and ECN (Explicit Congestion Notification). Among them, ECN technology means that when a device is congested, the ECN field in the IP header of the message is marked, and the receiving end sends a CNP (Congestion Notification Packet) message to the sending end to reduce the sending rate, thereby achieving end-to-end congestion management and slowing down the spread of congestion.
[0004] The network card implements the DCQCN (Data Center Quantized Congestion Notification) congestion control mechanism for RoCEv2. This mechanism only requires the network switch to mark the congested packets with ECN, and the network cards at both ends of the communication adjust the flow rate according to the ECN marking. Existing switches all support marking the packets that encounter queue congestion with ECN to notify the source end to slow down the flow and alleviate the congestion of the switch.
[0005] The switch performs ECN marking on packets based on the configured ECN watermark. If the ECN watermark is set too high, the queue has a strong burst absorption capability, which is beneficial to throughput, but it will bring excessive queue depth and latency, which is not good for latency-sensitive control / protocol flows. On the contrary, if the ECN watermark is set too low, the queue maintains a low level of depth and low queue latency, which is beneficial for latency-sensitive service flows, but the queue has a weak burst absorption capability, which is not good for services with high throughput requirements.
[0006] How to reasonably set the ECN waterline has become a technical problem that needs to be solved urgently. Summary of the invention
[0007] In view of this, the present invention provides an ECN waterline adjustment method and device to improve the rationality of ECN waterline setting.
[0008] In a first aspect, the present invention provides an ECN waterline adjustment method, which is applied to a switching device, and the method comprises:
[0009] For a first converged Ethernet remote direct data access (ROCE) queue of a first port enabled with ECN, obtaining first specified aggregated statistical information of the first ROCE queue of the first port;
[0010] According to the first specified aggregate statistical information, query the current Q table to determine the first ECN waterline corresponding to the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table takes the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action;
[0011] Perform ECN processing on the first ROCE queue of the first port according to the first ECN waterline.
[0012] In a second aspect, the present invention provides an ECN waterline adjustment device, which is applied to a switching device, and the device comprises:
[0013] An acquiring unit is configured to acquire, for a first converged Ethernet remote direct data access (ROCE) queue of a first port enabled with ECN, first specified aggregated statistical information of a first ROCE queue of the first port;
[0014] A determination unit is used to query the current Q table according to the first specified aggregate statistical information to determine a first ECN waterline corresponding to the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table takes the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action;
[0015] A processing unit is configured to perform ECN processing on a first ROCE queue of the first port according to the first ECN waterline.
[0016] By applying the technical solution disclosed in the present invention, by using reinforcement learning Q-Learning to train the intelligent agent, a Q table for determining the optimal ECN waterline configuration under each state is obtained. Then, based on the Q table, the optimal ECN waterline corresponding to the obtained specified aggregation statistical information is determined, and ECN processing is performed based on the optimal ECN waterline, thereby improving the rationality of the ECN waterline configuration, thereby effectively improving performance indicators such as network throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flow chart of an ECN waterline adjustment method provided by an embodiment of the present invention;
[0018] Figure 2 is a schematic diagram of a Q table training process provided by an embodiment of the present invention;
[0019] Figure 3 It is a schematic diagram of the corresponding relationship between marking probability and queue length;
[0020] Figure 4 It is a structural schematic diagram of an ECN waterline adjustment device provided by an embodiment of the present invention;
[0021] Figure 5 It is a structural schematic diagram of another ECN waterline adjustment device provided by an embodiment of the present invention;
[0022] Figure 6 It is a structural schematic diagram of another ECN waterline adjustment device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable persons skilled in the art to better understand the technical solutions in the embodiments of the present invention, some terms involved in the embodiments of the present invention are briefly described below.
[0024] 1. DCQCN algorithm
[0025] The DCQCN algorithm is based on the combination of Data Center TCP (Transmission Control Protocol) (DCTCP for short) and the quantized notification algorithm. The DCQCN algorithm relies on the ECN marking on the switch side. ECN is a common feature of commercial data center switches. Two bits in the differential service field in the IP header of the data packet are used to indicate congestion. Once congestion occurs on the switch side, these two bits are set to "11".
[0026] Marking congestion is a probability function of queue length, such as Figure 3 As shown in Figure 2. The two thresholds of the queue length define the marking probability. When the queue length is below the lower threshold, the ECN bit is not marked. When the queue length exceeds the upper threshold, all network packets transmitted from the queue will be ECN marked. When the queue length is between the two thresholds, the data packets will be ECN marked with a probability that increases linearly with the queue length.
[0027] The data packet with ECN mark is propagated to the receiving NIC. The receiving NIC creates a CNP (Congestion Notification Packet) and sends it to the sender of the ECN marked data packet. The CNP data packet includes the marked QP (queue pair) information. When the CNP is received by the sending NIC, the sending NIC can reduce the transmission rate of the QP based on a specified algorithm (which can be called the DCQCN speed reduction algorithm).
[0028] The main principle of the DCQCN speed reduction algorithm is: if the QP is based on the internal timer and the sent byte counter, the algorithm will continue to increase the sending rate; if a CNP packet is received, the specified QP will be reduced. In addition, it also maintains a parameter called α, which reflects the congestion in the network and is used for speed reduction calculation.
[0029] 2. Reinforcement Learning
[0030] Reinforcement learning is a field in machine learning that emphasizes how to act based on the environment. The agent will choose different actions in the environment. These actions are not optimal at first, but after continuous trial and error, continuous attempts, accumulated experience, and learning experience, the optimal action can be found to maximize the expected benefits.
[0031] The environment receives a series of actions performed by the agent, evaluates the series of actions and converts them into a quantifiable signal to feed back to the agent.
[0032] The agent can perceive the state of the environment and learn to choose an appropriate action based on the feedback reward to maximize the long-term total benefit.
[0033] Q-Learning is a method of reinforcement learning that requires recording the learned strategies to inform the agent what actions to take under what circumstances to get the maximum reward value.
[0034] The Q-learning algorithm maintains a table (which can be called a Q-table). The first column represents the action and the first row represents the state. The value of each cell (i.e., each element) represents the maximum expected future reward (Q(s, a)) for a given state and the corresponding action. Based on the Q-table, the expected maximum future reward can be calculated for each action performed in each state. Based on the size of the expectation, the best action to take for each state can be known. In actual operation, the algorithm will continuously update the value of the corresponding element in the Q-table based on the reward of the executed action, thereby updating the strategy for the decision-making action.
[0035] In order to make the above-mentioned purposes, features and advantages of the embodiments of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention are further described in detail below with reference to the accompanying drawings.
[0036] See also Figure 1 , is a flow chart of an ECN waterline adjustment method provided by an embodiment of the present invention, wherein the cloud testing method can be applied to switching devices, such as switches, such as Figure 1 As shown, the ECN waterline adjustment method may include:
[0037] It should be noted that the serial numbers of the steps in the embodiment of the present invention do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0038] Step 101: For a first ROCE queue of a first port enabled with ECN, obtain first specified aggregation statistical information of the first ROCE queue of the first port.
[0039] In the embodiment of the present invention, the specified aggregated statistical information may include part or all of the aggregated statistical information of the ROCE queue.
[0040] Exemplarily, the aggregated statistical information of the ROCE queue may include, but is not limited to: average bandwidth of the ROCE outbound queue, Incast (the number of inbound ports corresponding to the ROCE data flow in the ROCE queue), the number of data flows (Flow) of each inbound port\the number of large-bandwidth data flows (BigFlow)\average bandwidth\write / read / send message type ratio, RTT (Round-Trip Time), NAK (Negative Acknowledgment), average outbound queue length, and the number of ECN-tagged messages.
[0041] Step 102: query the current Q table according to the first specified aggregate statistical information to determine the first ECN waterline corresponding to the value of the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table uses the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action.
[0042] In the embodiment of the present invention, considering that the static ECN configuration cannot be applied to all traffic scenarios and the network traffic in the actual scenario is constantly changing, in order to improve performance indicators such as network throughput, the optimal ECN waterline can be automatically adjusted based on the real-time perceived network traffic model to achieve network congestion control.
[0043] Accordingly, in an embodiment of the present invention, a Q-learning algorithm can be used to pre-train a Q table for dynamically determining an ECN watermark that adapts to different aggregate statistical information, so that in actual scenarios, the optimal ECN watermark for the aggregate statistical information acquired in real time can be determined based on the trained Q table.
[0044] Exemplarily, the ECN waterline may include a threshold lower limit (low-limit), a threshold upper limit (high-limit), and a discard probability (discard-probability).
[0045] For example, in the ECN waterline tuning scenario, the environment is an RDMA lossless network composed of switches and servers (network cards); the agent is the algorithm model; the action is the ECN waterline value issued; and the state is the environmental data collected by the switch (specified aggregate statistical information in the embodiment of the present invention).
[0046] In an embodiment of the present invention, during the training process of the Q table, the preset specified aggregate statistical information can be used as the state, and the preset ECN waterline can be issued as the action. Through training, the maximum future reward expectation for any action in any state can be determined.
[0047] Among them, the training process of Q table can be combined as follows Figure 2 The embodiments of the present invention are not described in detail here.
[0048] Exemplarily, for any ROCE queue (referred to herein as the first ROCE queue) of any ECN-enabled port (referred to herein as the first port), when the first specified aggregate statistical information of the first ROCE queue of the first port is obtained, the current Q table can be queried based on the first specified aggregate statistical information to determine the state corresponding to the first specified aggregate statistical information, and the action with the maximum expected maximum future reward in this state can be determined, and the ECN waterline corresponding to the action (referred to herein as the first ECN waterline) is determined as the optimal ECN waterline corresponding to the first specified aggregate statistical information.
[0049] Step 102: Perform ECN processing on the first ROCE queue of the first port according to the first ECN waterline.
[0050] In the embodiment of the present invention, when the switching device determines the first ECN waterline in the above manner, it can perform ECN processing on the first ROCE queue of the first port according to the first ECN waterline.
[0051] For example, assuming that the first ECN waterline includes a first threshold lower limit, a first threshold upper limit, and a first drop probability, when the length of the first ROCE queue of the first port is lower than the first threshold lower limit, the data packets in the first ROCE queue are not ECN marked; when the length of the first ROCE queue of the first port exceeds the first threshold upper limit, all data packets in the first ROCE queue are ECN marked; when the length of the first ROCE queue of the first port is between the first threshold lower limit and the first threshold upper limit, the data packets in the first ROCE queue are marked according to the first drop probability.
[0052] It can be seen that in Figure 1 In the method flow shown, by using reinforcement learning Q-Learning to train the intelligent agent, a Q table for determining the optimal ECN waterline configuration under each state is obtained. Then, based on the Q table, the optimal ECN waterline corresponding to the obtained specified aggregation statistical information is determined, and ECN processing is performed based on the optimal ECN waterline, which improves the rationality of the ECN waterline configuration, thereby effectively improving performance indicators such as network throughput.
[0053] It should be noted that, in the embodiment of the present invention, in order to improve the flexibility of the scheme control, for the ROCE queue of the ECN-enabled port, it can be selected whether to enable the ECN waterline adjustment scheme (which can be called dynamic ECN waterline adjustment) provided by the embodiment of the present invention according to actual needs. For any ROCE queue of any ECN-enabled port (such as the first ROCE queue of the first port mentioned above), if the dynamic ECN waterline adjustment is enabled for the ROCE queue of the port, dynamic ECN waterline adjustment can be performed according to the scheme provided by the embodiment of the present invention, that is, the optimal ECN waterline is dynamically determined in the manner described in steps 101 to 103, and ECN processing is performed according to the optimal ECN waterline; if the dynamic ECN waterline adjustment is not enabled for the ROCE queue of the port, ECN processing can be performed according to the traditional scheme, or other strategies can be used for ECN processing, which is not limited in the embodiment of the present invention.
[0054] In some embodiments, after performing the ECN processing according to the first ECN waterline, the following steps may also be included:
[0055] Obtain second specified aggregation statistical information of the first ROCE queue of the first port after ECN processing according to the first ECN waterline;
[0056] Determine and issue a first reward value corresponding to the first ECN waterline based on the second specified aggregate statistical information;
[0057] The value of the first element in the current Q table is updated according to the first reward value; wherein the first element is an element in the Q table located in the row corresponding to the first specified aggregate statistical information and in the column corresponding to the first ECN waterline.
[0058] For example, considering that there may be differences between the training environment of the Q table and the actual application scenario, the Q table obtained in the training environment may not be optimal. Therefore, when the trained Q table is applied to the actual application scenario for ECN waterline adjustment, the Q table can be iteratively updated according to the actual application scenario, so that the intelligent agent can quickly adapt to various application scenarios and issue the corresponding optimal configuration.
[0059] Accordingly, in accordance with Figure 1 The method flow shown determines a first ECN waterline, and after performing ECN processing on the first ROCE queue of the first port according to the first ECN waterline, specified aggregation statistical information (referred to herein as second specified aggregation statistical information) of the first ROCE queue of the first port after the ECN processing according to the first ECN waterline can also be obtained.
[0060] When the second specified aggregate statistical information is obtained, the reward value (referred to as the first reward value in this article) corresponding to the first ECN waterline can be determined based on the obtained second specified aggregate statistical information.
[0061] Exemplarily, after the first ECN waterline is issued, that is, after the first ROCE queue of the first port is ECN processed according to the first ECN waterline, the better the effect of reducing network congestion, the higher the reward value corresponding to issuing the first ECN waterline.
[0062] Exemplarily, when the reward value corresponding to the first ECN waterline (i.e., the first reward value) is determined, the current Q table can be updated based on the first reward value, that is, the element in the current Q table corresponding to the first specified aggregate statistical information and the first ECN waterline, that is, the element in the Q table located in the row corresponding to the first specified aggregate statistical information and the column corresponding to the first ECN waterline (referred to as the first element in this article) is updated.
[0063] For example, assuming that the first specified aggregate statistical information corresponds to the mth state in the Q table, and the first ECN waterline corresponds to the nth action in the Q table, the value of the element corresponding to the nth action in the mth state in the Q table can be updated according to the first reward value.
[0064] It should be noted that, in the embodiment of the present invention, for any ROCE queue of any ECN-enabled port (e.g., the first ROCE queue of the first port mentioned above), the switching device may periodically obtain the specified aggregation statistical information of the ROCE queue of the ECN port (e.g., the first specified aggregation statistical information or the second specified aggregation statistical information mentioned above), for example, the specified aggregation statistical information of the ROCE queue of the ECN port may be obtained every 500 ms. Wherein, each time the switching device obtains the specified aggregation statistical information of the ROCE queue of the port, the optimal ECN waterline corresponding to the currently obtained aggregation statistical information may be determined in the manner described in step 102, and the current ECN waterline may be adjusted according to the determined optimal ECN waterline, so as to perform ECN processing on the ROCE queue of the port according to the determined optimal ECN waterline.
[0065] For example, when the above-mentioned second specified aggregate statistical information is obtained, the current Q table (the Q table updated according to the first reward value) can also be queried based on the second specified aggregate statistical information to determine the optimal ECN waterline corresponding to the second specified aggregate statistical information, and the ECN waterline can be adjusted based on the optimal ECN waterline.
[0066] See also Figure 2 , is a flow chart of a Q table training method provided by an embodiment of the present invention, such as Figure 2 As shown, the Q table training method may include the following steps:
[0067] Step 201: Initialize the Q table.
[0068] Step 202: For a second ROCE queue of a second port with ECN enabled in a training environment, obtain third specified aggregation statistical information of the second ROCE queue of the second port, and determine a current state according to the third specified aggregation statistical information.
[0069] Step 203: randomly select a preset action, and perform ECN processing on the second ROCE queue of the second port according to the second ECN waterline corresponding to the preset action.
[0070] Step 204: Obtain fourth specified aggregation statistical information after the second ROCE queue of the second port performs ECN processing according to the second ECN waterline.
[0071] Step 205: Calculate and issue a second reward value corresponding to the second ECN waterline based on the fourth specified aggregate statistical information, and update the value of the second element in the Q table based on the second reward value; and update the current state based on the fourth specified aggregate statistical information, and jump to the step of randomly selecting a preset action until the training end condition is met; wherein the second element is an element in the Q table that is located in the row corresponding to the third specified aggregate statistical information and in the column corresponding to the second ECN waterline.
[0072] Exemplarily, during the training process, the preset specified aggregate statistical information can be used as the state, and the preset ECN waterline can be issued as the action to construct a Q table and initialize the elements in the Q table, for example, initialize the elements in the Q table to 0.
[0073] For example, assuming that the preset specified aggregate statistical information includes a total of 100 value conditions (i.e., a total of 100 states), and the preset ECN waterline includes 30 value conditions (i.e., a total of 30 actions), the Q table can be shown as Figure 1:
[0074] Table 1
[0075] Action 1 Action 2 … Action 30 State 1 Q(1,1) Q(1,2) Q(1,30) State 2 Q(2,1) Q(2,2) Q(2,30) … Status 100 Q(100,1) Q(100,2) Q(100,30)
[0076] Among them, excluding the table header (i.e., the first row and the first column), the Q table is a 100*30 table, and the element (Q(m, n)) in the mth row and nth column of the table (excluding the part other than the first row and the first column) is the expected value of the maximum future reward for performing action n under state m; wherein, the initial value of each element can be 0.
[0077] Exemplarily, during the Q table training process, specified aggregation statistical information (referred to as the third specified aggregation statistical information herein) of any ROCE queue (referred to as the second ROCE queue herein) of any ECN-enabled port (referred to as the second port herein) in the training environment can be obtained, and the current state can be determined based on the third specified aggregation statistical information.
[0078] For example, the Q table may be queried according to the third specified aggregate statistical information, and the state in the Q table that matches the third specified aggregate statistical information may be determined as the current state.
[0079] When the current state is determined, a preset action may be randomly selected, and ECN processing may be performed with an ECN waterline (referred to herein as a second ECN waterline) corresponding to the preset action.
[0080] Exemplarily, after performing ECN processing according to the second ECN waterline, specified aggregate statistical information (referred to herein as fourth specified aggregate statistical information) of the second ROCE queue of the second port after performing ECN processing according to the second ECN waterline may be obtained.
[0081] For example, assuming that the acquisition period of the specified aggregate statistical information is 500 ms, the time interval between the time of acquiring the fourth specified aggregate statistical information and the time of acquiring the third specified aggregate statistical information may be 500 ms.
[0082] Exemplarily, when the fourth specified aggregate statistical information is obtained, on the one hand, the reward value corresponding to the second ECN waterline (referred to as the second reward value in this article) can be calculated and issued based on the fourth specified aggregate statistical information, and the value of the element in the Q table that is located in the row corresponding to the third specified aggregate statistical information and in the column corresponding to the second ECN waterline (referred to as the second element in this article) can be updated based on the second reward value.
[0083] On the other hand, the current state can be updated according to the fourth specified aggregate attack information, and the process jumps to the step of randomly selecting a preset action, that is, jumps to step 203, and continues to update the Q table until the training end condition is reached, for example, the reinforcement learning algorithm model converges.
[0084] In some embodiments, the above-mentioned specified aggregation statistical information may include: link bandwidth, Incast, queue length, outbound port traffic, and the number of large bandwidth data flows.
[0085] Exemplarily, in order to prevent the reinforcement learning algorithm model from converging too slowly during the Q-table training process, the specified aggregate statistical information as a state may not need to include all types of aggregate statistical information, but may include some types of aggregate statistical information.
[0086] Exemplarily, the above-mentioned specified aggregate statistical information may include link bandwidth, Incast, queue length, outbound port traffic, and the number of large-bandwidth data flows, that is, the state of the intelligent agent is constituted by these five indicators, thereby improving the efficiency of Q-table training while ensuring the network optimization control effect.
[0087] In one example, the reward value corresponding to the ECN waterline is determined in the following way:
[0088] The reward value corresponding to the ECN waterline is determined based on the queue length and outbound port traffic in the specified aggregation statistics obtained after the ECN waterline is issued.
[0089] For example, considering that latency and traffic can well characterize network congestion, latency and traffic can be used as optimization directions for ECN waterline tuning.
[0090] According to laboratory data verification, it can be found that there is a high correlation between queue length and latency, and queue length has the advantage of being easy to measure. Therefore, queue length can be used to measure the optimization reward of latency.
[0091] Accordingly, for an ECN waterline adjustment, when the specified aggregation statistical information after the ECN adjustment is obtained (such as the second specified aggregation statistical information or the fourth specified aggregation statistical information mentioned above), the reward value corresponding to the ECN waterline (such as the first reward value or the second reward value mentioned above) can be determined based on the queue length and egress port traffic in the obtained specified aggregation statistical information.
[0092] As an example, determining the reward value corresponding to issuing the ECN waterline according to the queue length and the outbound port flow in the specified aggregated statistical information obtained after issuing the ECN waterline may include:
[0093] The reward value r corresponding to the ECN waterline is determined by the following formula:
[0094] r=ω1×T(R)-ω2×D(L)
[0095] Among them, T(R) is the outbound port traffic in the specified aggregation statistical information obtained after the ECN waterline is issued, D(L) is the queue length in the specified aggregation statistical information obtained after the ECN waterline is issued, ω1+ω2=1, and ω1 and ω2 are both positive numbers.
[0096] Exemplarily, considering that the larger the outbound port flow in the above-specified aggregate statistical information, the better the network congestion control effect is, and the larger the queue length in the specified aggregate statistical information, the worse the network congestion control effect is.
[0097] Accordingly, the above formula can be used to determine the reward value corresponding to the ECN waterline.
[0098] It should be noted that in actual deployment, different ω1 and ω2 can be set according to specific application scenarios, and different weights can be given to the queue length D(L) and the egress port traffic T(R).
[0099] For example, in storage scenarios, traffic optimization is more important, and a higher weight can be set for the port traffic T(R).
[0100] For AI computing scenarios, higher latency requirements are required, and a higher weight can be given to the queue length D(L).
[0101] In order to enable those skilled in the art to better understand the technical solution provided by the embodiment of the present invention, the technical solution provided by the embodiment of the present invention is described below in conjunction with specific application scenarios.
[0102] In this embodiment, taking the switching device as a switch as an example, the switch may include an ECN process and an AI application process. The ECN process may be used to obtain aggregated statistical information for the ROCE queue of the ECN-enabled port and report the above-specified aggregated statistical information to the AI application process.
[0103] For example, the ECN process and the AI application process (hereinafter referred to as the application process) can use gRPC (google Remote Procedure Calls) to exchange data. The ECN process can act as a gRPC client, and the AI application process can act as a gRPC server.
[0104] In this embodiment, the ECN waterline adjustment solution implementation process is as follows:
[0105] 1. The ECN process of the switch counts and manages the ROCE data flow, periodically obtains the specified aggregation statistics and current ECN waterline of the specified ROCE queue, and sends them to the AI application process in gRPC mode.
[0106] For example, ROCE data flows are generally uniformly mapped to a specified priority queue by various devices on the network, and PFC, ECN and other configurations are enabled on the priority queue to achieve lossless forwarding. For example, in a common RDMA configuration, a cos 5 queue or a cos 4 queue is set as a ROCE queue.
[0107] The ECN process sends the ROCE data stream to the FPGA or CPU through sampling mirroring to manage and count the data stream 3-tuples.
[0108] Exemplarily, statistics on ROCE data flows may include: number of packets, total packet length, average packet length, service flow rate, number of packet losses, service inbound port / outbound port (unicast), VXLAN (Virtual Extensible Local Area Network) encapsulation information, inactive time, etc.
[0109] To assist the application process in adjusting the ECN waterline of the ROCE queue, the ECN process of the switch selects the ROCE data flow with the ROCE queue as the outgoing queue and performs aggregation statistics based on the ROCE queue under each ECN-enabled port.
[0110] Exemplarily, the aggregated statistical information may include: average bandwidth of ROCE outbound queue, Incast (the number of inbound ports corresponding to the ROCE data flow in the ROCE queue), number of data flows (Flow) of each inbound port, number of large-bandwidth data flows (BigFlow), average bandwidth, write / read / send message type ratio, RTT, NAK, average outbound queue length, and number of ECN-tagged messages.
[0111] The ECN process can periodically send these aggregated statistics to the application process in gRPC mode.
[0112] 2. AI ECN Qlearning scenario definition and parameter selection.
[0113] For example, in the AI ECN Qlearning scenario, the environment is an RDMA lossless network composed of switches and servers (network cards); the intelligent agent is the algorithm model (that is, the above-mentioned reinforcement learning algorithm model); the action is the issued ECN waterline (low-limit, high-limit, discard-probability).
[0114] For example, in order to reduce the dimension and speed up the convergence of the agent algorithm model, the discard-probability can be set to 0.2, and the low-limit and high-limit can be discretized (10 low-limits and 8 high-limits).
[0115] The status includes five indicators: link bandwidth, incast, queue length, outbound port traffic, and number of high-bandwidth data flows.
[0116] Exemplarily, the state can be discretized into 4480 states (2 link bandwidths, 25G and 100G, a total of 2 types; 7 incast 2-8, a total of 7 types; 10 queue lengths, 8 outbound port traffic, and 4 large bandwidth data flow numbers).
[0117] It should be noted that when determining the status based on the obtained aggregate statistical information, an exact match may not be required. For example, taking the egress port traffic as an example, the above-mentioned 8 types of egress port traffic do not need to be a single value, but can be a value range. When the egress port traffic in the obtained specified aggregate statistical information falls into a certain value range and other indicators also match accordingly, it can be determined that the status corresponding to the currently obtained specified aggregate statistical information is the status corresponding to the value range.
[0118] The design of the reward function r selects two key indicators: queue length D(L) and outbound port traffic T(R), which correspond to the two optimization directions of ECN waterline tuning: latency and traffic.
[0119] r=ω1×T(R)-ω2×D(L)
[0120] Among them, T(R) is the outbound port traffic in the specified aggregation statistical information obtained after the ECN waterline is issued, D(L) is the queue length in the specified aggregation statistical information obtained after the ECN waterline is issued, ω1+ω2=1, and ω1 and ω2 are both positive numbers.
[0121] For example, the indicators corresponding to the action and state are counted by the ECN process and transmitted to the application process using gRPC.
[0122] Exemplarily, the ECN process may report the above indicators every 500 ms; the application process updates the state, calculates the reward value, updates the Q table, and then selects the next action based on the received indicators.
[0123] Exemplarily, the queue length is counted every 25 ms, and the average value within 500 ms is counted.
[0124] 3. Train the AI ECN agent (i.e. the Q table training mentioned above).
[0125] 3.1. Initialize the Q table, create a 4480*80 data table, and initialize the elements to 0;
[0126] 3.2. Obtain the specified aggregate statistical information of the specified ROCE queue (such as the second ROCE queue of the second port mentioned above) of the specified port with ECN enabled in the training environment, and determine the current state of the agent according to the specified aggregate statistical information;
[0127] 3.3. Randomly select actions (during the training process, the Q table is improved by randomly selecting actions);
[0128] 3.4. Enable the action on the switch by sending a command line through netconf, that is, send the ECN watermark corresponding to the action;
[0129] 3.5. The ECN process transmits the specified aggregated statistical information after ECN processing according to the issued ECN waterline to the agent through gRPC, and the agent and the specified aggregated statistical information are updated;
[0130] 3.6. Based on the new state, the agent calculates the reward value corresponding to the action;
[0131] 3.7. Update the value of the corresponding element in the Q table according to the reward value (the method for determining the element to be updated refers to the relevant description in the above embodiment);
[0132] 3.8. If the training end condition is not met, go to step 3.3 (the state is the updated state in step 3.5 at this time) until the training end condition is met, and then end the training.
[0133] For example, after a large number of cycles, the expected maximum future reward in the Q table will approach the true value. In the subsequent reasoning process, the best action that suits the environment can be selected based on the expected value of the maximum future reward.
[0134] 4. Deploy in actual scenarios.
[0135] 4.1. Initialize the Q table: The Q table is selected from the Q table trained in 3) to reduce the training time in the actual environment;
[0136] 4.2. For any ROCE queue of any ECN-enabled port (such as the first ROCE queue of the first port mentioned above), obtain the specified aggregate statistical information of the ROCE queue, and determine the state of the agent based on the obtained specified aggregate statistical information;
[0137] 4.3. Action selection: Based on the current state, query the Q table and select the action with the largest expected value of future rewards;
[0138] 4.4. Enable the action on the switch by sending a command line through netconf, that is, send the ECN waterline corresponding to the action;
[0139] 4.5. The ECN process transmits the specified aggregated statistical information after ECN processing according to the issued ECN waterline to the agent through gRPC, and the agent and the specified aggregated statistical information are updated;
[0140] 4.6. Based on the new state, the agent calculates the reward value corresponding to the action
[0141] 4.7. Update the value of the corresponding element in the Q table according to the reward value (the method for determining the element to be updated refers to the relevant description in the above embodiment);
[0142] 4.8. Go to step 4.3 (the current state is the updated state in step 4.5).
[0143] See also Figure 4 , is a schematic diagram of the structure of an ECN waterline adjustment device provided in an embodiment of the present invention, wherein the device can be applied to the switching device in the above method embodiment, such as Figure 4 As shown, the ECN waterline adjustment device may include:
[0144] An acquiring unit 410 is configured to acquire, for a first Converged Ethernet Remote Direct Data Access (ROCE) queue of a first ECN-enabled port, first specified aggregated statistical information of a first ROCE queue of the first port;
[0145] The determination unit 420 is used to query the current Q table according to the first specified aggregate statistical information to determine the first ECN waterline corresponding to the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table takes the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action;
[0146] The processing unit 430 is configured to perform ECN processing on the first ROCE queue of the first port according to the first ECN waterline.
[0147] In some embodiments, the acquisition unit 410 is further configured to acquire second specified aggregation statistical information after the first ROCE queue of the first port performs ECN processing according to the first ECN waterline;
[0148] The determining unit 420 is further configured to determine and send a first reward value corresponding to the first ECN waterline according to the second specified aggregate statistical information;
[0149] like Figure 5 As shown, the device also includes:
[0150] The updating unit 440 is used to update the value of the first element in the current Q table according to the first reward value; wherein the first element is the element in the Q table located in the row corresponding to the first specified aggregate statistical information and in the column corresponding to the first ECN waterline.
[0151] In some embodiments, Figure 6 As shown, the device also includes:
[0152] The training unit 450 is used to:
[0153] Initialize Q table;
[0154] For a second ROCE queue of a second port with ECN enabled in a training environment, obtaining third specified aggregation statistical information of the second ROCE queue of the second port, and determining a current state according to the third specified aggregation statistical information;
[0155] Randomly select a preset action, and perform ECN processing on the second ROCE queue of the second port according to the second ECN waterline corresponding to the preset action;
[0156] Obtain fourth specified aggregation statistical information after the second ROCE queue of the second port performs ECN processing according to the second ECN waterline;
[0157] Calculate and issue a second reward value corresponding to the second ECN waterline based on the fourth specified aggregate statistical information, and update the value of the second element in the Q table based on the second reward value; and update the current state based on the fourth specified aggregate statistical information, and jump to the step of randomly selecting a preset action until the training end condition is met; wherein the second element is an element in the Q table that is located in the row corresponding to the third specified aggregate statistical information and in the column corresponding to the second ECN waterline.
[0158] In some embodiments, the specified aggregate statistical information includes: link bandwidth, Incast, queue length, outbound port traffic, and the number of large bandwidth data flows.
[0159] In some embodiments, the determining unit 420 is specifically configured to determine a reward value corresponding to the ECN waterline according to the queue length and the egress port flow in the specified aggregated statistical information obtained after the ECN waterline is issued.
[0160] In some embodiments, the determining unit 420 is specifically configured to determine the reward value r corresponding to the ECN waterline by the following formula:
[0161] r=ω1×T(R)-ω2×D(L)
[0162] Among them, T(R) is the outbound port traffic in the specified aggregation statistical information obtained after the ECN waterline is issued, D(L) is the queue length in the specified aggregation statistical information obtained after the ECN waterline is issued, ω1+ω2=1, and ω1 and ω2 are both positive numbers.
[0163] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.
[0164] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Ordinary technicians in this field can understand and implement it without paying creative work.
[0165] It can be seen from the above embodiments that by using reinforcement learning Q-Learning to train the intelligent agent, a Q table for determining the optimal ECN waterline configuration in each state is obtained. Then, based on the Q table, the optimal ECN waterline corresponding to the acquired specified aggregation statistical information is determined, and ECN processing is performed based on the optimal ECN waterline, which improves the rationality of the ECN waterline configuration, thereby effectively improving performance indicators such as network throughput.
[0166] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0167] It should be understood that the present invention is not limited to the exact construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for adjusting the ECN waterline, characterized in that: Applied to a switching device, the method comprises: For a first converged Ethernet remote direct data access (ROCE) queue of a first port enabled with ECN, obtaining first specified aggregated statistical information of the first ROCE queue of the first port; According to the first specified aggregate statistical information, query the current Q table to determine the first ECN waterline corresponding to the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table takes the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action; Performing ECN processing on the first ROCE queue of the first port according to the first ECN waterline; Among them, the training process of the Q table includes: Initialize Q table; For a second ROCE queue of a second port with ECN enabled in a training environment, obtaining third specified aggregation statistical information of the second ROCE queue of the second port, and determining a current state according to the third specified aggregation statistical information; Randomly select a preset action, and perform ECN processing on the second ROCE queue of the second port according to the second ECN waterline corresponding to the preset action; Obtain fourth specified aggregation statistical information after the second ROCE queue of the second port performs ECN processing according to the second ECN waterline; Calculate and issue a second reward value corresponding to the second ECN waterline based on the fourth specified aggregate statistical information, and update the value of the second element in the Q table based on the second reward value; and update the current state based on the fourth specified aggregate statistical information, and jump to the step of randomly selecting a preset action until the training end condition is met; wherein the second element is an element in the Q table that is located in the row corresponding to the third specified aggregate statistical information and in the column corresponding to the second ECN waterline.
2. The method according to claim 1, characterized in that: After performing ECN processing according to the first ECN waterline, the method further includes: Obtain second specified aggregation statistical information after the first ROCE queue of the first port performs ECN processing according to the first ECN waterline; Determine and issue a first reward value corresponding to the first ECN waterline according to the second specified aggregate statistical information; The value of the first element in the current Q table is updated according to the first reward value; wherein the first element is an element in the Q table located in the row corresponding to the first specified aggregate statistical information and in the column corresponding to the first ECN waterline.
3. The method according to any one of claims 1 to 2, characterized in that: The specified aggregation statistical information includes: link bandwidth, Incast, queue length, outbound port flow, and the number of large bandwidth data flows.
4. The method according to claim 3, characterized in that The reward value corresponding to the ECN waterline is determined in the following way: The reward value corresponding to the ECN waterline is determined based on the queue length and outbound port traffic in the specified aggregation statistics obtained after the ECN waterline is issued.
5. The method according to claim 4, characterized in that The step of determining the reward value corresponding to the ECN waterline according to the queue length and the outbound port flow in the specified aggregated statistical information obtained after the ECN waterline is issued includes: The reward value r corresponding to the ECN waterline is determined by the following formula: r=ω1×T(R)-ω2×D(L) Among them, T(R) is the outbound port traffic in the specified aggregation statistical information obtained after the ECN waterline is issued, D(L) is the queue length in the specified aggregation statistical information obtained after the ECN waterline is issued, ω1+ω2=1, and ω1 and ω2 are both positive numbers.
6. An ECN waterline adjustment device, characterized in that: Applied to a switching device, the device comprises: An acquiring unit is configured to acquire, for a first converged Ethernet remote direct data access (ROCE) queue of a first port enabled with ECN, first specified aggregated statistical information of a first ROCE queue of the first port; A determination unit is used to query the current Q table according to the first specified aggregate statistical information to determine a first ECN waterline corresponding to the first specified aggregate statistical information; wherein the initial value of each element in the Q table is the value of each element in the pre-trained Q table, each row element of the Q table corresponds to the same state, each column element corresponds to the same action, and the Q table takes the preset specified aggregate statistical information as the state and sends the preset ECN waterline as the action; a processing unit, configured to perform ECN processing on a first ROCE queue of the first port according to the first ECN waterline; Training unit for: Initialize Q table; For a second ROCE queue of a second port with ECN enabled in a training environment, obtaining third specified aggregation statistical information of the second ROCE queue of the second port, and determining a current state according to the third specified aggregation statistical information; Randomly select a preset action, and perform ECN processing on the second ROCE queue of the second port according to the second ECN waterline corresponding to the preset action; Obtain fourth specified aggregation statistical information after the second ROCE queue of the second port performs ECN processing according to the second ECN waterline; Calculate and issue a second reward value corresponding to the second ECN waterline based on the fourth specified aggregate statistical information, and update the value of the second element in the Q table based on the second reward value; and update the current state based on the fourth specified aggregate statistical information, and jump to the step of randomly selecting a preset action until the training end condition is met; wherein the second element is an element in the Q table that is located in the row corresponding to the third specified aggregate statistical information and in the column corresponding to the second ECN waterline.
7. The device according to claim 6, characterized in that The acquisition unit is further used to acquire second specified aggregation statistical information after the first ROCE queue of the first port performs ECN processing according to the first ECN waterline; The determining unit is further configured to determine and send a first reward value corresponding to the first ECN waterline based on the second specified aggregate statistical information; The device also includes: An updating unit is used to update the value of a first element in the current Q table according to the first reward value; wherein the first element is an element in the Q table located in the row corresponding to the first specified aggregate statistical information and in the column corresponding to the first ECN waterline.
8. The device according to any one of claims 6 to 7, characterized in that: The specified aggregation statistical information includes: link bandwidth, Incast, queue length, outbound port flow, and the number of large bandwidth data flows.
9. The device according to claim 8, characterized in that The determining unit is specifically used to determine the reward value corresponding to the ECN waterline according to the queue length and the outbound port flow in the specified aggregation statistical information obtained after the ECN waterline is issued.
10. The device according to claim 9, characterized in that The determining unit is specifically used to determine the reward value r corresponding to the ECN waterline by the following formula: r=ω1×T(R)-ω2×D(L) Among them, T(R) is the outbound port traffic in the specified aggregation statistical information obtained after the ECN waterline is issued, D(L) is the queue length in the specified aggregation statistical information obtained after the ECN waterline is issued, ω1+ω2=1, and ω1 and ω2 are both positive numbers.
