Network flow control method of RDMA (Remote Direct Memory Access) network card and related device
By using two-level windows to perform traffic control during RDMA transmission, the sub-window baseline of the sub-transmission window is updated in real time, solving the problem of poor transmission performance in network traffic control by existing RDMA transmission solutions, and improving transmission performance and adaptability.
Patent Information
- Application Number
- CN202411189907.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-08-28
AI Technical Summary
The existing RDMA transmission schemes have poor transmission performance during network traffic control, especially in the long-distance complex network topology between data centers, where transmission performance is limited.
A network traffic control method for RDMA network card is proposed. By using two-level windows in the RDMA transmission process, the sub-transmission window is used for window updates, the transmission window is used for overall control, and the sub-window baseline of the sub-transmission window is updated in real time based on the transmission state and transmission distance.
The transmission performance of the RDMA transmission solution in the network traffic control process is improved, and the actual transmission traffic is adapted to the end-to-end flow control of the RDMA network card is realized, reducing the impact of the intermediate switch on the transmission traffic.
Smart Images

Figure CN119544628A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network traffic control method and related devices for an RDMA network card. Background Art
[0002] Remote Direct Memory Access (RDMA) is to "directly" access the memory of the remote node through the local node of RDMA. The so-called direct means that it can access the remote memory just like accessing the local memory (Direct Memory Access, DMA), bypassing the complex TCP / IP network protocol stack of traditional Ethernet, and the remote end is unaware of this process, that is, it does not require the participation of the CPU, and most of the work of this reading and writing process is completed by hardware rather than software.
[0003] The RDMA transmission scheme implemented in the related art has high requirements on the hardware environment. Most of them are based on switches in the data center or switches plus network cards. Therefore, they are highly dependent on switches. However, due to the long-distance and complex network topology structure of the interconnection between data centers, solutions with low dependence on switches are required. Therefore, the RDMA transmission scheme in the related art has poor transmission performance during the network traffic control process. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a network traffic control method and related devices for an RDMA network card, so as to improve the transmission performance of the RDMA transmission scheme during the network traffic control process.
[0005] To achieve the above object, a first aspect of an embodiment of the present application proposes a network traffic control method for an RDMA network card, comprising:
[0006] In response to a transmission request corresponding to a task queue element, obtaining, according to transmission parameters of data to be transmitted, at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window;
[0007] Under the transmission window, generating transmission permission information of the sub-transmission window according to resource data of the sub-transmission window;
[0008] When the transmission permission information indicates that the sub-transmission window is in a sending state, encapsulating at least one information message based on the sub-window baseline, and transmitting the information message to a receiving party, wherein the information message includes an identifier for instructing the receiving party to generate a feedback message according to a reception result of the information message;
[0009] Acquire the feedback message generated by the receiver, obtain the transmission state and the transmission distance according to the feedback message, and update the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance.
[0010] In some embodiments, the feedback message includes an ACK message, and the updating the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance includes:
[0011] Determine to update the next sub-transmission window according to the message sequence number of the ACK message;
[0012] Based on the ACK message, the transmission distance is updated, and the transmission state of the current sub-transmission window is generated, and the distance change information of the transmission distance corresponding to the adjacent sub-transmission window is obtained;
[0013] When the distance change information indicates that the transmission distance becomes smaller, the sub-window baseline of the next sub-transmission window is increased based on the transmission status; otherwise, the sub-window baseline of the next sub-transmission window is decreased based on the transmission status.
[0014] In some embodiments, increasing the sub-window baseline of the next sub-transmission window based on the transmission state includes:
[0015] The current transmission state is a bad state, and the current transmission state is a good state, obtaining a maximum sub-window baseline under the transmission window, and adjusting the sub-window baseline of the next sub-transmission window to the maximum sub-window baseline;
[0016] The sub-window baseline of the subsequent sub-transmission window is increased according to a first preset ratio based on the previous sub-window baseline, and the maximum sub-window baseline is updated until the distance change information indicates that the transmission distance becomes larger.
[0017] In some embodiments, reducing the sub-window baseline of the next sub-transmission window based on the transmission state includes:
[0018] Obtaining a distance change of the transmission distance;
[0019] When the distance variation exceeds a preset distance threshold, the sub-window baseline of the next sub-transmission window is reduced according to a second preset ratio; otherwise, the sub-window baseline of the next sub-transmission window is adjusted in combination with the previous transmission state.
[0020] In some embodiments, the adjusting the sub-window baseline of the next sub-transmission window in combination with the previous transmission state includes:
[0021] If the previous transmission state is a good state, adjusting the current transmission state to a poor state;
[0022] If the previous transmission state is a state difference, the state quantity of the continuous state difference is obtained, and when the state quantity exceeds a preset state threshold, the sub-window baseline of the next sub-transmission window is reduced according to a third preset ratio.
[0023] 6. The network traffic control method of the RDMA network card according to claim 2, characterized in that the updating of the next sub-transmission window according to the message sequence number of the ACK message comprises:
[0024] Obtain the sub-transmission window corresponding to the message sequence number of the ACK message, and obtain a minimum sequence number to be confirmed based on the sub-transmission window;
[0025] When the message sequence number of the ACK message is greater than or equal to the minimum sequence number to be confirmed, it is determined to update the next sub-transmission window.
[0026] In some embodiments, obtaining, according to the transmission parameters of the data to be transmitted, at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window includes:
[0027] Acquire transmission parameters, where the transmission parameters include one or more of link bandwidth, optical device conversion rate, transmission distance, distance incorporation rate, maximum transmission unit, and number of sub-windows, and there is a first data relationship between the number of sub-windows and the maximum transmission unit;
[0028] At least one transmission window is calculated according to the transmission parameters, and the sub-window baseline is calculated according to the number of sub-windows.
[0029] In some embodiments, updating the transmission distance based on the ACK message includes:
[0030] Acquire the sending timestamp of the information message that the identifier indicates generates the ACK message, and the receiving timestamp of the ACK message;
[0031] Generate a time difference between the receiving timestamp and the sending timestamp;
[0032] The transmission distance is calculated based on the time difference and the optical equipment conversion rate.
[0033] In some embodiments, generating the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window includes:
[0034] Querying resource data corresponding to the current sub-transmission window from the window management information;
[0035] If the resource data exists, adjusting the transmission permission information to a sending state;
[0036] If the resource data does not exist, generate the resource data, update the information message of the sub-transmission window, and adjust the transmission permission information to a sending state;
[0037] If the resource data cannot be generated, the transmission permission information is adjusted to a stop state.
[0038] In some embodiments, encapsulating at least one information message based on the sub-window baseline includes:
[0039] Acquire the data to be transmitted based on the task queue element;
[0040] Determining data content in the information message according to the sub-window baseline, and generating a message sequence number according to the transmission order of the information message;
[0041] Based on the message sequence number, taking the first information message of the transmission window and the last information message of each sub-transmission window as the information message to be fed back;
[0042] The identifier in the information message to be fed back is set to one, and the identifiers of other information messages are set to zero.
[0043] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application proposes a network traffic control device for an RDMA network card, comprising:
[0044] A parameter calculation module: used for obtaining, in response to a transmission request corresponding to a task queue element, a sub-window baseline of at least one transmission window and a sub-transmission window of each transmission window according to a transmission parameter of the data to be transmitted;
[0045] The permission acquisition module is used to generate the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window;
[0046] A data generation and sending module: used for encapsulating at least one information message based on the sub-window baseline and transmitting the information message to a receiving party when the transmission permission information indicates that the sub-transmission window is in a sending state, wherein the information message includes an identifier for instructing the receiving party to generate a feedback message according to a reception result of the information message;
[0047] Update module: used for acquiring the feedback message generated by the receiving party, and obtaining the transmission state and the transmission distance according to the feedback message, and updating the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance.
[0048] To achieve the above objectives, a third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.
[0049] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a storage medium, which is a storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0050] The network flow control method and related device of the RDMA network card proposed in the embodiment of the present application obtain the sub-window baseline of at least one transmission window and the sub-transmission window of each transmission window according to the transmission parameters of the data to be transmitted, and generate the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window. When the transmission permission information indicates that the sub-transmission window is in the sending state, encapsulate at least one information message based on the sub-window baseline, and transmit the information message to the receiver, the information message includes an identifier for indicating that the receiver generates a feedback message according to the reception result of the information message, obtains the feedback message generated by the receiver, and obtains the transmission state and transmission distance according to the feedback message, and updates the sub-window baseline of the next sub-transmission window based on the transmission state and transmission distance. In the embodiment of the present application, a two-level window method is used to control the flow in the RDMA transmission process, wherein the sub-transmission window is used for window update, and the transmission window is used for overall control. And the sub-window baseline of the next sub-transmission window is updated in real time based on the transmission state and transmission distance to better adapt to the actual transmission flow. The end-to-end flow control of the RDMA network card is realized, and the intermediate switch is used as a transparent transmission node to reduce the impact of the intermediate switch on the transmission flow. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a schematic diagram of an implementation scenario of the network traffic control method of the RDMA network card provided in an embodiment of the present application.
[0052] Figure 2 A schematic diagram of a transmission window provided in an embodiment of the present application.
[0053] Figure 3 It is a flow chart of a network traffic control method of an RDMA network card provided in an embodiment of the present application.
[0054] Figure 4 It is a schematic diagram of calculating the transmission distance in an embodiment of the present application.
[0055] Figure 5 It is a flowchart of generating transmission permission information of a sub-transmission window according to resource data of the sub-transmission window provided by an embodiment of the present application.
[0056] Figure 6 It is a flowchart of encapsulating at least one information message based on a sub-window baseline provided by an embodiment of the present application.
[0057] Figure 7 This is a schematic diagram of an information message feedback node provided in an embodiment of the present application.
[0058] Figure 8 It is a schematic diagram of the information message sending process of the sub-transmission window provided in an embodiment of the present application.
[0059] Fig. 9 A schematic diagram of a flow chart of updating a sub-window baseline of a next sub-transmission window based on a transmission state and a transmission distance provided in an embodiment of the present application.
[0060] Fig.10 An overall flow chart of updating the sub-window baseline of the next sub-transmission window provided in an embodiment of the present application.
[0061] Fig.11 Schematic diagram of the maximum sub-window baseline provided in an embodiment of the present application.
[0062] Fig.12 It is a schematic diagram of sub-window baseline adjustment provided in an embodiment of the present application.
[0063] Fig.13 It is a module schematic diagram of the network traffic control method of the RDMA network card provided in an embodiment of the present application.
[0064] Fig.14 This is a structural block diagram of a network traffic control device for an RDMA network card provided by another embodiment of the present application.
[0065] Fig.15 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0066] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0067] It should be noted that although the functional modules are divided in the device schematic and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0069] Remote Direct Memory Access (RDMA) is to "directly" access the memory of the remote node through the local node of RDMA. The so-called direct means that it can access the remote memory just like accessing the local memory (Direct Memory Access, DMA), bypassing the complex TCP / IP network protocol stack of traditional Ethernet, and the remote end is unaware of this process, that is, it does not require the participation of the CPU, and most of the work of this reading and writing process is completed by hardware rather than software.
[0070] The implementation of RDMA transmission solutions in related technologies has high requirements for the hardware environment. Most of them are based on switches in data centers or switches plus network cards. Therefore, they are highly dependent on switches. However, due to the long-distance and complex network topology structure, the interconnection between data centers requires solutions with less dependence on switches. For example, the RoCE (RDMA over Converged Ethernet) protocol based on the Ethernet link layer or the iWARP (internet Wide Area RDMA Protocol) protocol based on TCP. However, the mechanism of the RoCE protocol itself has certain transmission losses, and the iWARP protocol also has certain transmission losses when the TCP connection is unreliable. Therefore, the RDMA transmission solution in related technologies has poor transmission performance during network traffic control.
[0071] Based on this, the embodiment of the present application provides a network flow control method and related device for an RDMA network card, which performs flow control by using a two-level window method during the RDMA transmission process, wherein the sub-transmission window is used for window update and the transmission window is used for overall control. And the sub-window baseline of the next sub-transmission window is updated in real time based on the transmission status and transmission distance to better adapt to the actual transmission flow. The end-to-end flow control of the RDMA network card is realized, and the intermediate switch is used as a transparent transmission node to reduce the impact of the intermediate switch on the transmission flow.
[0072] The embodiments of the present application provide a network traffic control method and a related device for an RDMA network card, which are specifically described through the following embodiments. First, the network traffic control method for an RDMA network card in the embodiments of the present application is described.
[0073] The network traffic control method of the RDMA network card provided in the embodiment of the present application relates to the field of communication technology. The network traffic control method of the RDMA network card provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be a computer program running in the terminal or the server side. For example, the computer program can be a native program or software module in the operating system; it can be a local (Native) application (APP, Application), that is, a program that needs to be installed in the operating system to run, such as a client that supports the network traffic control of the RDMA network card, or it can be a small program, that is, a program that can be run only by downloading it to the browser environment; it can also be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plug-in. Among them, the terminal communicates with the server through the network. The network traffic control method of the RDMA network card can be executed by the terminal or the server, or by the terminal and the server in collaboration.
[0074] In some embodiments, the terminal may be a smart phone, a tablet computer, a laptop computer, a desktop computer or a smart watch. The server may be an independent server, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms; or a service node in a blockchain system, wherein each service node in the blockchain system forms a peer-to-peer (P2P, PeerTo Peer, P2P) network, and the P2P protocol is an application layer protocol running on the Transmission Control Protocol (TCP) protocol. The terminal and the server may be connected via Bluetooth, Universal Serial Bus (USB) or a network or other communication connection methods, which are not limited in this embodiment.
[0075] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0076] First refer to Figure 1 , Figure 1 It is a schematic diagram of an implementation scenario of the network traffic control method of the RDMA network card provided in an embodiment of the present application.
[0077] Figure 1 The process includes a sender and a receiver. The sender uses the network to send a piece of data to be transmitted in the sender's memory to the receiver. The sender's RDMA network card (RNIC) sends the data to be transmitted through a transmission window. Each transmission window corresponds to a fragment of data.
[0078] Among them, the RDMA network card is a network adapter specially used for remote direct memory access (RDMA). It directly establishes a direct memory mapping channel between the source computer and the target computer, allowing the computer to directly access the memory of another computer through the network without the intervention of the CPU or operating system. RDMA network cards usually support various RDMA protocols, such as InfiniBand, RoCE (RDMA over ConvergedEthernet), etc.
[0079] In one embodiment, in order to improve transmission efficiency and reliability, the transmission windows are graded in the embodiment of the present application, and each transmission window includes at least one sub-transmission window. Through this division method, the data corresponding to the transmission window is further subdivided into smaller data blocks to better control the speed and order of data transmission.
[0080] It can be understood that each sub-transmission window includes at least: a starting address, a sub-window baseline and a window sequence number, wherein the starting address indicates the starting position of the data corresponding to the sub-transmission window in the memory, the sub-window baseline indicates the size of the sub-transmission window, that is, the amount of data to be sent, and the window sequence number is used to identify the order of each sub-transmission window so that the receiver can reassemble the data correctly. When the sender is ready to send the relevant data of a certain transmission window, the data is divided into multiple sub-transmission windows in the form of sub-transmission windows, and they are sent to the receiver one by one. After receiving the relevant data, the receiver will reassemble it according to the window sequence number to restore the original data order. This method can achieve efficient data transmission and allow the sender to dynamically adjust the transmission speed according to the network conditions and the processing capacity of the receiver. At the same time, a certain degree of error recovery mechanism is also provided. If the data of a sub-transmission window is lost or damaged, the data can be repaired by resending the sub-transmission window.
[0081] Reference Figure 2 , Figure 2 A schematic diagram of a transmission window provided in an embodiment of the present application. Figure 2 N transmission windows are shown, denoted by win1, win2, win3, ..., winN, wherein each transmission window includes M sub-transmission windows, denoted by sub_winX, for example, the i-th sub-transmission window of win1 is denoted by sub_win1i, and the M-th sub-transmission window of winN is denoted by sub_winNM.
[0082] The following describes a network traffic control method for an RDMA network card in an embodiment of the present application.
[0083] Figure 3 is an optional flow chart of the network traffic control method of the RDMA network card provided in the embodiment of the present application. Figure 3 The method may include but is not limited to steps 110 to 140. It can also be understood that this embodiment Figure 3 The order of step 110 to step 140 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.
[0084] Step 110: In response to a transmission request corresponding to a task queue element, obtain at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window according to transmission parameters of the data to be transmitted.
[0085] In one embodiment, in RDMA transmission, the control plane sends a work queue element (WQE) to the task management module, triggering the task management module to start data request operation. Specifically, when the application needs to transmit data via RDMA, first create a task queue element and add it to the task queue. This task queue element contains information such as source memory address, target memory address, data length, etc. The control plane then takes out the task queue element from the task queue and passes it to the task management module. After receiving the task queue element, the task management module determines the current data transmission request based on the information therein. Therefore, in an embodiment of the present application, in response to the transmission request corresponding to the task queue element, prepare to perform RDMA data transmission, and control network traffic during data transmission.
[0086] Next, in one embodiment, at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window are obtained in advance according to the transmission parameters of the data to be transmitted. The process is described as follows: obtaining transmission parameters, the transmission parameters include one or more of link bandwidth, optical device conversion rate, transmission distance, distance incorporation rate, maximum transmission unit, and number of sub-windows, there is a first data relationship between the number of sub-windows and the maximum transmission unit, and there is a second data relationship between the distance incorporation rate and the transmission distance. Then, at least one transmission window is calculated according to the transmission parameters, and the sub-window baseline is calculated according to the number of sub-windows.
[0087] The complete calculation process described above is described below.
[0088] First, in order to fully utilize the high throughput performance of RDMA in the embodiment of the present application, the RDMA transmission process is set to be continuously sent under an ideal state, and the transmission window sent is expressed as:
[0089] swnd=BW×RTT
[0090] Among them, swnd represents the transmission window, BW represents the link bandwidth, which is expressed in bytes. For example, for a 100 Gbps network card, the link bandwidth may be 100000000000 / 8=12500000000 Byte, and RTT (Round-Trip Time) represents the round-trip transmission time.
[0091] When the transmission distance between the sender and the receiver is expressed as Distance (km), the ideal value of the transmission time RTT during optical transmission is:
[0092]
[0093] Among them, V lightRepresents the speed of light. When a signal is transmitted in an optical fiber, the transmission rate is about 2 / 3 of the speed of light. Therefore, the transmission time in the optical fiber is approximately:
[0094]
[0095] In the actual transmission process, there will be processing processes of intermediate optical devices, etc. Therefore, in order to quantify the delay effect of this processing process on the transmission process, the embodiment of the present application introduces the optical device conversion rate λ r Among them, the optical equipment discount rate λ r The value of is [0.5~0.9], for example, it can be 0.6.
[0096] Then the transmission time in the actual optical fiber is approximately:
[0097]
[0098] Assuming the speed of light is 300,000 km / s, the actual transmission time in optical fiber is approximately:
[0099]
[0100] According to the above formula, the relationship between transmission time and transmission distance can be expressed as:
[0101] Distance=RTT×λ r ×10 5
[0102] In one embodiment, the transmission distance between the sender and the receiver can be calculated during the negotiation phase before transmission. Figure 4 , Figure 4 It is a schematic diagram of calculating the transmission distance in an embodiment of the present application.
[0103] During the negotiation, the sender first sends other parameter negotiation requests to the receiver, and the receiver returns a request response result. Next, the receiver sends a reference message with a timestamp Tn to the receiver. After receiving the corresponding reference message, the receiver generates a corresponding response message and returns the timestamp value intact to the sender. After receiving the response message, the sender records the received timestamp Tn' and calculates the difference between the two timestamps to get the round-trip time. Through multiple negotiation processes, an average response time RTT is calculated. dis , expressed as:
[0104]
[0105] Here, m represents the negotiation process, which is no less than 3 times. The figure shows 3 negotiation processes, and the timestamps carried in these three negotiation processes are T1, T2 and T3 respectively.
[0106] The response time RTT dis Substituting the transmission time into the relationship between the transmission time and the transmission distance, the current transmission distance can be calculated.
[0107] After obtaining the transmission distance, link bandwidth, and optical equipment conversion rate, the transmission window can be calculated. At this time, the transmission window is expressed as:
[0108]
[0109] Therefore, the transmission window can be calculated based on part of the transmission parameters, such as link bandwidth, optical equipment conversion rate, and transmission distance. The calculation process of the sub-window baseline is described below.
[0110] In one embodiment, the distance incorporation rate λ is introduced c To quantify the number of connections or operations that can be active simultaneously in the RDMA transmission process in a multi-QP (Queue Pair) environment, the transmission window is updated to:
[0111]
[0112] In one embodiment, the data to be transmitted needs to be encapsulated according to the maximum transmission unit (MTU) size during the transmission process. Therefore, the number of packets corresponding to each transmission window is P. c It is expressed as:
[0113]
[0114] When the number of sub-windows in a sub-transmission window is θ, θ is set according to the actual hardware capability. At this time, the number of messages in the sub-transmission window is P s It is expressed as:
[0115]
[0116] Next, align the sub-transmission windows according to the n-bit width to obtain the actual sub-window baseline P s_base , expressed as:
[0117] P s_base =[(P s +2 n -1)>>n]< <n
[0118] The above-mentioned n-bit width is 4 to 8 according to the hardware capability, for example, it can be 4.
[0119] Specifically, the number of packets in the sub-transmission window P s The operation of aligning to n bits is implemented by shifting. First, Ps +2 n -1 ensures that P s +2 n -1 is adjusted to a number divisible by 2 before alignment, ensuring that no packet information is lost during the alignment operation in the next step. Then, the ">>n" operation is used to shift the adjusted value n bits to the right, which is equivalent to dividing the value by 2 n , obtaining a quotient aligned based on 2 n . Finally, through the "<<n" operation, the obtained quotient is shifted n bits to the left, that is, multiplied by 2 n , obtaining the final sub-window baseline P n . Through this operation, it is ensured that the sub-window baseline P s_base can not only effectively reflect the actual data volume in the sub-transmission window, but also improve the data processing speed and reduce the boundary error through memory alignment. This is particularly important for concurrent operations in a multi-QP environment because the synchronization and interoperation between multiple QPs require high data consistency and low latency.
[0120] Next, after obtaining the sub-window baseline monkey, the window baseline P of the transmission window can also be obtained according to the sub-window baseline c_base , expressed as:
[0121] P c_base = P s_base ×θ
[0122] where the minimum transmission unit MTU is the result of negotiation between the sender and the receiver. For example, it can take values such as 256, 512, 1024, 2048, 4096, etc., and the minimum transmission unit affects the number of sub-windows. There is a first data relationship between them: the number of sub-windows θ is selected according to the inverse index of MTU. For example, when the minimum transmission unit MTU is 256, the number of sub-windows θ is 8. An example of the first data relationship is as follows:
[0123]
[0124] In one embodiment, according to the transmission protocol definition of RDMA, the timer for the expected maximum time interval is expressed as:
[0125] Timeout = 4.096 μsec × 2 Interval
[0126] where Interval represents the timer interval and Timeout represents the expected maximum time interval.
[0127] Theoretically, the expected maximum time interval should be slightly greater than the transmission time of the packet. In the embodiment of the present application, half of the expected maximum time interval Timeout is used as the round-trip time RTTdis During the estimation of transmission distance, assuming that the optical equipment discount rate λ r is 0.6, at this time the data relationship between the timer interval and the transmission distance can be obtained, as shown in Table 1 below.
[0128]
[0129]
[0130] Table 1 Data relationship between timer interval and transmission distance
[0131] As can be seen from the above, in one embodiment, according to the data relationship in Table 1, if the transmission distance is known, a reasonable timer can be adaptively set, or conversely, an adaptive transmission distance can be set for the manually set timer. In this way, reasonable parameters are adaptively set to improve the data stability and accuracy of the transmission process.
[0132] In one embodiment, since the transmission distance affects the distance integration rate, the timer interval and the distance integration rate λ are determined according to the actual measurement results. c There exists a second data relation between them, expressed as:
[0133]
[0134] In one embodiment, in combination with the above calculation process, a 100 Gbps port is used as an example to calculate the transmission parameters. Assume that the optical device discount rate λ r Take 0.6, the maximum transmission unit MTU is 1024, the number of sub-windows is 6, and the light rate is 200000. At this time, the public information is expressed as shown in Table 2 below.
[0135] Link bandwidth Bps Fiber speed (km) Optical equipment discount rate Discount rate MTU Number of sub-windows 12500000000 200000 0.6 120000 1024 6
[0136] Table 2 Public Information Schematic Next, the transmission parameters calculated according to the public information in Table 2 are expressed as Table 3 below.
[0137] Distance(km) Distance Incorporation Rate RTT(us) Window Bytes Pc Ps <![CDATA[P s_base ]]> <![CDATA[P c_base ]]> 120 128 2000 195312.5 191 32 32 192 2400 512 40000 976562.5 954 159 160 960
[0138] After obtaining the sub-window baseline of at least one transmission window and the sub-transmission window of each transmission window, the amount of fragmented data that needs to be sent by each transmission window and the amount of fragmented data of each sub-transmission window can be determined. The embodiment of the present application also adjusts the amount of data transmitted by each sub-transmission window in the transmission window, as described below.
[0139] Step 120: Under the transmission window, the transmission permission information of the sub-transmission window is generated according to the resource data of the sub-transmission window.
[0140] In one embodiment, the process of generating transmission permission information of a sub-transmission window based on the resource data of the sub-transmission window specifically includes: querying the resource data corresponding to the current sub-transmission window from the window management information; if the resource data exists, adjusting the transmission permission information to a sending state; if the resource data does not exist, generating the resource data, updating the start and end information messages of the sub-transmission window, and adjusting the transmission permission information to a sending state; if the resource data cannot be generated, adjusting the transmission permission information to a stopped state.
[0141] Reference Figure 5 , Figure 5 It is a flowchart of generating transmission permission information of a sub-transmission window according to resource data of the sub-transmission window provided by an embodiment of the present application.
[0142] Combination Figure 5 In the RDMA transmission process of the embodiment of the present application, the window management module is used to manage the resource allocation of each transmission window and the sub-transmission window. The window management module can be used to maintain and manage the state of the sending window. Therefore, the window management module includes the current window management information, such as the window size, window position and other information. Therefore, the currently sent transmission window or sub-transmission window can be determined according to the window management information. For each transmission window, if the resource data corresponding to the current sub-transmission window is queried from the window management information, this resource data is called a sub-window management information block. If a sub-window management information block exists, it means that the resources required for transmission have been allocated to this sub-transmission window before, and then the transmission permission information of the sub-transmission window is updated to the sending state. In other words, the sub-transmission window can perform or continue to send data, because the fragmented data of each sub-transmission window in the embodiment of the present application can be divided into one or more data packets for transmission. Next, if it is determined that the sub-window management information block does not exist, it means that a new sub-transmission window needs to be created to send data packets. At this time, the resource data corresponding to the new sub-transmission window needs to be created. If it can be successfully created, the information messages at the start and end positions of the sub-transmission window and the information messages that need to be sent in the middle are determined, and the transmission permission information is adjusted to the sending state, indicating that the data of the sub-transmission window can be sent. If the creation fails and the resource data cannot be generated, that is, there are not enough resources to support the sending operation of the new sub-transmission window, the transmission permission information is adjusted to the stop state.
[0143] Next, the flow control decision process is carried out.
[0144] Step 130: When the transmission permission information indicates that the sub-transmission window is in a sending state, encapsulate at least one information message based on the sub-window baseline, and transmit the information message to the receiver.
[0145] In one embodiment, the information message includes an identifier for instructing the receiving party to generate a feedback message according to the reception result of the information message. If the transmission permission information indicates that the sub-transmission window is in the sending state, the information message encapsulation and sending process can be performed. Figure 6 , Figure 6 This is a flowchart of encapsulating at least one information message based on a sub-window baseline provided by an embodiment of the present application, which specifically includes the following steps:
[0146] Step 610: Obtain data to be transmitted based on the task queue element.
[0147] Step 620: Determine the data content in the information message according to the sub-window baseline, and generate a message sequence number according to the transmission order of the information message.
[0148] In one embodiment, the data to be transmitted is read from the memory according to the task queue element, and then the sliced data corresponding to each transmission window is determined according to the window baseline of the transmission window, and then the sliced data is further divided based on the sub-transmission window. It can be understood that, in theory, the amount of data to be transmitted in each sub-transmission window can be determined according to the sub-window baseline of each sub-transmission window, and the sub-window baseline corresponding to the first sub-transmission window in the embodiment of the present application is calculated according to the transmission parameters, and the sub-window baselines of the subsequent sub-transmission windows will be updated in real time according to the actual transmission situation, and the update process will be described in detail below.
[0149] The embodiment of the present application obtains the data content corresponding to each information message in the current sub-transmission window according to the sub-window baseline. Since the number of information messages in each sub-transmission window can be multiple, the message sequence number corresponding to each information message is also generated according to the transmission order of the information messages.
[0150] Step 630: Based on the message sequence number, the first information message of the transmission window and the last information message of each sub-transmission window are taken as information messages to be fed back.
[0151] Since each sub-transmission window has several information messages to be transmitted, in order to avoid the accumulation of errors caused by transmission errors of some information messages, the receiver needs to provide feedback on the reception results of some information messages. Considering that the sub-transmission window is sent continuously, the information messages in the sub-transmission window are also sent continuously. Therefore, in order to reduce the number of feedbacks, refer to Figure 7 , Figure 7Schematic diagram of information message feedback node provided by the embodiment of the present application. The first information message of the transmission window and the last information message of each sub-transmission window are used as information messages to be fed back, and the receiving party is required to give feedback in the information message to be fed back, so that the accuracy of the transmission data of each sub-transmission window can be judged, and no frequent feedback is required, which can save transmission bandwidth and reduce computing costs. It can be understood that the first information message of the data to be transmitted and the first information message of the first sub-transmission window of the first transmission window are repeated.
[0152] In one embodiment, referring to Figure 8 , Figure 8 It is a schematic diagram of the information message sending process of the sub-transmission window provided in an embodiment of the present application. Figure 8 Taking one of the transmission windows as an example, the first information message in sub-transmission window 0 (the first sub-transmission window), the last information message in sub-transmission window 0, the last information message in sub-transmission window 1, etc., need to be fed back by the receiver.
[0153] Step 640: Set the identifier in the information message to be fed back to one, and set the identifiers of other information messages to zero.
[0154] In one embodiment, in order to allow the receiver to distinguish the information message to be fed back from the information message, the A (Acknowledge Request) field in the BTH (Base Transport Header) header of the information message is used as an identifier, the identifier in the information message to be fed back is set to 1, and the identifiers of other information messages are set to 0. For example: the identifier of the first information message of the transmission task, that is, the first information message of the first transmission window is set to 1. The identifier of the last information message of the transmission task, that is, the last information message of the last sub-transmission window of the last transmission window is set to 1. The identifier of the last information message of each sub-transmission window is set to 1. The identifiers of other information messages are all set to 0.
[0155] Next, in one embodiment, the corresponding information message is sent and the expected feedback message is received. The feedback message includes an ACK (Acknowledgment) message and a NAK (Negative Acknowledgment) message. If the receiving party successfully receives the information message to be fed back, an ACK message is sent to the sending party as a feedback message, indicating that the information message has been correctly received. If the receiving party does not receive the information message to be fed back, or other errors occur, a NAK message is sent to the sending party as a feedback message, indicating that the information message needs to be resent.
[0156] Step 140: Acquire the feedback message generated by the receiver, obtain the transmission status and transmission distance according to the feedback message, and update the sub-window baseline of the next sub-transmission window based on the transmission status and transmission distance.
[0157] In one embodiment, after sending the first sub-transmission window, the sender needs to update the sub-window baseline of the subsequent sub-transmission window in real time according to the feedback message generated by the receiver. The transmission status can be determined by the feedback message. For example, if the reception time of the feedback message is later than the expected time, the status is judged to be poor. If it is close to the expected time, the status is judged to be good. The expected time here is set by the sender according to actual needs.
[0158] In one embodiment, in combination Figure 8 According to the time difference between the sending time of the to-be-feedback message and the receiving time of the corresponding feedback message, combined with the relationship between the transmission time and the transmission distance, the real-time transmission distance corresponding to the current sub-transmission window can also be determined.
[0159] After obtaining the transmission distance and transmission status, it is determined whether the sub-window baseline of the next transmission window needs to be updated. Fig. 9 , Fig. 9 A schematic diagram of a process for updating a sub-window baseline of a next sub-transmission window based on a transmission state and a transmission distance provided in an embodiment of the present application specifically includes the following steps:
[0160] Step 910: Determine to update the next sub-transmission window according to the message sequence number of the ACK message.
[0161] In one embodiment, referring to Fig.10 , Fig.10 An overall flow chart of updating the sub-window baseline of the next sub-transmission window provided in an embodiment of the present application.
[0162] First, when the feedback message is an ACK message, it is determined whether the information message corresponding to the current sub-transmission window has been transmitted. Only when the information message transmission of the current sub-transmission window is completed can the next sub-transmission window be switched.
[0163] In one embodiment, the sub-transmission window corresponding to the message sequence number of the ACK message is obtained, and the minimum sequence number to be confirmed is obtained based on the sub-transmission window. When the message sequence number of the ACK message is greater than or equal to the minimum sequence number to be confirmed, it is determined to switch to the next sub-transmission window. The minimum sequence number to be confirmed here can be the message sequence number of the first information message in the sub-transmission window.
[0164] Combination Figure 8, if the current is sub-transmission window 0, and the ACK message at this time is the feedback message corresponding to the first information message, then the minimum sequence number to be confirmed is the message sequence number corresponding to the first information message. At this time, the message sequence number of the ACK message is greater than the current minimum sequence number to be confirmed, and the sub-window baseline of sub-transmission window 1 can be updated. At this time, the information message of sub-transmission window 1 has not been transmitted, so the data size of the information message therein can be determined according to the updated sub-window baseline. At the same time, sub-transmission window 0 continues to transmit information messages until the transmission is completed. Next, for sub-transmission window 1, an ACK message is received during its data transmission phase. At this time, its corresponding minimum sequence number to be confirmed is the message sequence number corresponding to the first information message of sub-transmission window 1, and the sub-window baseline of the next sub-transmission window can be updated accordingly.
[0165] Step 920: Update the transmission distance based on the ACK message, generate the transmission status of the current sub-transmission window, and obtain the distance change information of the transmission distance corresponding to the adjacent sub-transmission window.
[0166] In one embodiment, to update the sub-window baseline of the next sub-transmission window, it is necessary to obtain the current transmission performance data. The embodiment of the present application updates the transmission distance according to the ACK message, generates the transmission status of the current sub-transmission window, and obtains the distance change information of the transmission distance corresponding to the adjacent sub-transmission window. Fig.10 If it is the first transmission of the first sub-transmission window, the transmission distance calculated by the transmission parameters is used as the default value, and the default value of the transmission status is set. The default value can be a pending status, and the transmission status is updated after receiving the ACK message.
[0167] In the case of non-first transmission, the sender has received an ACK message returned by at least one receiver, obtains the sending timestamp of the information message indicating the generation of the ACK message and the receiving timestamp of the ACK message, generates a time difference between the receiving timestamp and the sending timestamp, and then calculates the transmission distance based on the time difference and the optical equipment conversion rate according to the relationship between the transmission time and the transmission distance.
[0168] The calculated real-time transmission distance is compared with the transmission distance corresponding to the previous sub-transmission window to generate distance change information.
[0169] Step 930: When the distance change information indicates that the transmission distance becomes smaller, the sub-window baseline of the next sub-transmission window is increased based on the transmission status; otherwise, the sub-window baseline of the next sub-transmission window is decreased based on the transmission status.
[0170] In one embodiment, in combination Fig.10, if the distance change information indicates that the transmission distance is getting smaller, it means that the transmission performance is getting better for the transmission, so the sub-window baseline can be expanded to increase the amount of data sent each time. Specifically, each ACK message can generate a transmission state, so the previous transmission state is obtained for reference. If the previous transmission state is in a poor state and the current transmission state is in a good state, it means that the transmission performance is on a trend of getting better, so the sub-window baseline can be quickly increased, for example, the maximum sub-window baseline under the transmission window is obtained, and then the sub-window baseline of the next sub-transmission window is directly adjusted to the maximum sub-window baseline. It can be understood that the sub-window baseline in the transmission window in the embodiment of the present application will not be less than the sub-window baseline initially calculated according to the transmission parameters.
[0171] Reference Fig.11 , Fig.11 Schematic diagram of the maximum sub-window baseline provided in an embodiment of the present application. Fig.11 The sub-window baselines in the transmission window are sorted, the smallest one is the sub-window baseline initially calculated according to the transmission parameters, that is, base in the figure, the largest sub-window baseline is max in the figure, max is greater than the sub-window baseline level_1, the sub-window baseline level_1 is greater than the sub-window baseline level_2, ..., and then when the rapid increase is performed, the corresponding sub-window baseline can be directly adjusted to the maximum sub-window baseline max.
[0172] Reference Fig.12 , Fig.12 It is a schematic diagram of sub-window baseline adjustment provided in an embodiment of the present application. Fig.12 The sub-window baseline from sub-transmission window T1 to sub-transmission window T3 is constantly increasing, the sub-window baseline from sub-transmission window T4 to sub-transmission window T5 is constantly decreasing, and the sub-transmission window of sub-transmission window T6 is increasing. Therefore, the previous transmission state is a bad state, and the current transmission state is a good state, which indicates that the transmission performance is improving. The sub-window baseline of the sub-transmission window is switched to the maximum sub-window baseline, that is, the sub-window baseline corresponding to sub-transmission window T3.
[0173] Further, assuming that the network performance continues to improve, the sub-window baseline of the subsequent sub-transmission window can be increased based on the previous sub-window baseline according to the first preset ratio, and the maximum sub-window baseline needs to be updated after each increment until the distance change information indicates that the transmission distance has increased, that is, the network transmission performance may deteriorate, and then the increment operation is stopped. The first preset ratio here can be 10%, which can be adjusted according to actual conditions.
[0174] In one embodiment, if the distance change information indicates that the transmission distance has increased, it is necessary to reduce the sub-window baseline of the next sub-transmission window based on the transmission status. Fig.10At this time, the actual distance change of the transmission distance is obtained. When the distance change exceeds the preset distance threshold, it is considered that the network performance is greatly reduced, and the sub-window baseline of the next sub-transmission window is directly reduced according to the second preset ratio. The second preset ratio here can be 10%, which can be adjusted according to the actual situation.
[0175] If the distance change does not exceed the preset distance threshold, the sub-window baseline of the next sub-transmission window can be adjusted in combination with the previous transmission status. Fig.10 If the previous transmission state is good, considering that the network performance has deteriorated, the current transmission state is adjusted to poor state, and the state number is recorded as 1 for subsequent decision-making. If the previous transmission state is also poor, the number of consecutive poor states is obtained. When the state number exceeds the preset state threshold, it can also be said that the network performance is greatly reduced, and the sub-window baseline of the next sub-transmission window can be reduced according to the third preset ratio. The third preset ratio here can be 10%, which can be adjusted according to the actual situation.
[0176] Similarly, when the transmission distance does not decrease and the transmission state is good, the subsequent sub-transmission windows can be gradually reduced according to the third preset ratio, and the minimum sub-window baseline needs to be recorded to ensure that it is not less than the basic sub-window baseline initially calculated according to the transmission parameters. It can be understood that after the sub-window baseline in a transmission window changes, the number of sub-transmission windows can be dynamically adjusted according to the actual situation within the large framework of the window baseline of the transmission window.
[0177] In one embodiment, when the feedback message is a NAK message or the ACK message is not received for a long time, the subwindow baseline is directly reduced according to the fourth preset ratio. The fourth preset ratio here can be 10%, which can be adjusted according to actual conditions.
[0178] In one embodiment, referring to Fig.13 , Fig.13 It is a module schematic diagram of the network traffic control method of the RDMA network card provided in an embodiment of the present application.
[0179] Among them, the window management module executes step 1, responds to the transmission request corresponding to the task queue element, and obtains the sub-window baseline of at least one transmission window and the sub-transmission window of each transmission window according to the transmission parameters of the data to be transmitted. Next, step 2 is executed, and the control plane sends the task queue element to the task management module, triggering the task management module to start data request. The flow control decision module executes steps 3, 4, 5, and 6, and generates the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window. After the flow control decision module determines that the transmission is allowed, step 7 enters the data sending module for sending processing. When the transmission permission information indicates that the sub-transmission window is in the sending state, the data sending module encapsulates at least one information message based on the sub-window baseline and transmits the information message to the receiver. Next, step 8, the receiving module is responsible for triggering the sub-window baseline update of the sub-transmission window according to the ACK message or NAK message replied by the receiving party. In step 9, the evaluation update module determines whether to update according to the transmission distance and transmission status. In step 10, the window management module updates the sub-window baseline.
[0180] The embodiment of the present application is an RDMA network card that supports the RoCEv2 protocol. It uses one or more of the link bandwidth, optical device conversion rate, transmission distance, distance incorporation rate, maximum transmission unit, and number of sub-windows to calculate the sub-window baseline, so that the window division process can better adapt to a changing environment. In addition, the transmission window is reclassified into sub-transmission windows using a hierarchical window method. The sub-transmission window is used for fast calculation and update, and the transmission window controls the overall sliding window process. And adopt a strategy of rising fast and falling slow. When the speed reduction is triggered, the window is slowly lowered, and when the window is restored, the window is quickly raised to improve the update efficiency of the sub-window baseline.
[0181] The technical solution provided by the embodiment of the present application is to obtain the sub-window baseline of at least one transmission window and the sub-transmission window of each transmission window according to the transmission parameters of the data to be transmitted, and under the transmission window, the transmission permission information of the sub-transmission window is generated according to the resource data of the sub-transmission window. When the transmission permission information indicates that the sub-transmission window is in a sending state, at least one information message is encapsulated based on the sub-window baseline, and the information message is transmitted to the receiver, the information message includes an identifier for indicating that the receiver generates a feedback message according to the reception result of the information message, obtains the feedback message generated by the receiver, and obtains the transmission state and transmission distance according to the feedback message, and updates the sub-window baseline of the next sub-transmission window based on the transmission state and transmission distance. In the embodiment of the present application, a two-level window method is used to control the flow in the RDMA transmission process, wherein the sub-transmission window is used for window update, and the transmission window is used for overall control. And the sub-window baseline of the next sub-transmission window is updated in real time based on the transmission state and transmission distance to better adapt to the actual transmission flow. The end-to-end flow control of the RDMA network card is realized, and the intermediate switch is used as a transparent transmission node to reduce the impact of the intermediate switch on the transmission flow.
[0182] The present application also provides a network traffic control device for an RDMA network card, which can implement the network traffic control method for the RDMA network card. Fig.14 , the device comprises:
[0183] Parameter calculation module 1410: used to respond to the transmission request corresponding to the task queue element, and obtain the sub-window baseline of at least one transmission window and each sub-transmission window of the transmission window according to the transmission parameters of the data to be transmitted.
[0184] The authority acquisition module 1420 is used to generate the transmission authority information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window.
[0185] Data generation and sending module 1430: used to encapsulate at least one information message based on the sub-window baseline and transmit the information message to the receiving party when the transmission permission information indicates that the sub-transmission window is in the sending state, and the information message includes an identifier for instructing the receiving party to generate a feedback message according to the reception result of the information message.
[0186] Update module 1440: used to obtain the feedback message generated by the receiver, and obtain the transmission state and transmission distance according to the feedback message, and update the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance.
[0187] The specific implementation of the network traffic control device of the RDMA network card in this embodiment is basically the same as the specific implementation of the network traffic control method of the RDMA network card described above, and will not be repeated here.
[0188] The present application also provides an electronic device, including:
[0189] at least one memory;
[0190] at least one processor;
[0191] at least one program;
[0192] The program is stored in the memory, and the processor executes the at least one program to implement the network traffic control method of the RDMA network card implemented in the present application. The electronic device can be any intelligent terminal including a server, a mobile phone, a tablet computer, a personal digital assistant (PDA), a car computer, etc.
[0193] See also Fig.15 , Fig.15 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0194] The processor 1501 may be implemented by a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0195] The memory 1502 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1502 can store an operating system and other applications. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1502, and the processor 1501 calls and executes the network traffic control method of the RDMA network card in the embodiment of this application;
[0196] Input / output interface 1503, used to implement information input and output;
[0197] Communication interface 1504, used to realize communication interaction between the device and other devices, which can be realized by wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.); and
[0198] A bus 1505 that transmits information between the various components of the device (e.g., the processor 1501, the memory 1502, the input / output interface 1503, and the communication interface 1504);
[0199] The processor 1501 , the memory 1502 , the input / output interface 1503 and the communication interface 1504 are connected to each other in communication within the device via the bus 1505 .
[0200] An embodiment of the present application further provides a storage medium, which is a storage medium storing a computer program. When the computer program is executed by a processor, the network traffic control method of the RDMA network card is implemented.
[0201] As a non-transitory storage medium, the memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0202] The network flow control method and related device of the RDMA network card proposed in the embodiment of the present application obtain the sub-window baseline of at least one transmission window and the sub-transmission window of each transmission window according to the transmission parameters of the data to be transmitted, and generate the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window. When the transmission permission information indicates that the sub-transmission window is in the sending state, encapsulate at least one information message based on the sub-window baseline, and transmit the information message to the receiver, the information message includes an identifier for indicating that the receiver generates a feedback message according to the reception result of the information message, obtains the feedback message generated by the receiver, and obtains the transmission state and transmission distance according to the feedback message, and updates the sub-window baseline of the next sub-transmission window based on the transmission state and transmission distance. In the embodiment of the present application, a two-level window method is used to control the flow in the RDMA transmission process, wherein the sub-transmission window is used for window update, and the transmission window is used for overall control. And the sub-window baseline of the next sub-transmission window is updated in real time based on the transmission state and transmission distance to better adapt to the actual transmission flow. The end-to-end flow control of the RDMA network card is realized, and the intermediate switch is used as a transparent transmission node to reduce the impact of the intermediate switch on the transmission flow.
[0203] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0204] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0205] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0206] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0207] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0208] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0209] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0210] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0211] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0212] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store programs.
[0213] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A network traffic control method for an RDMA network card, characterized in that: include: In response to a transmission request corresponding to a task queue element, obtaining, according to transmission parameters of data to be transmitted, at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window; Under the transmission window, generating transmission permission information of the sub-transmission window according to resource data of the sub-transmission window; When the transmission permission information indicates that the sub-transmission window is in a sending state, encapsulating at least one information message based on the sub-window baseline, and transmitting the information message to a receiving party, wherein the information message includes an identifier for instructing the receiving party to generate a feedback message according to a reception result of the information message; Acquire the feedback message generated by the receiver, obtain the transmission state and the transmission distance according to the feedback message, and update the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance.
2. The network traffic control method of the RDMA network card according to claim 1, characterized in that: The feedback message includes an ACK message, and the updating of the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance includes: Determine to update the next sub-transmission window according to the message sequence number of the ACK message; Based on the ACK message, the transmission distance is updated, and the transmission state of the current sub-transmission window is generated, and the distance change information of the transmission distance corresponding to the adjacent sub-transmission window is obtained; When the distance change information indicates that the transmission distance becomes smaller, the sub-window baseline of the next sub-transmission window is increased based on the transmission status; otherwise, the sub-window baseline of the next sub-transmission window is decreased based on the transmission status.
3. The network traffic control method of the RDMA network card according to claim 2, characterized in that: The increasing the sub-window baseline of the next sub-transmission window based on the transmission state comprises: The current transmission state is a bad state, and the current transmission state is a good state, obtaining a maximum sub-window baseline under the transmission window, and adjusting the sub-window baseline of the next sub-transmission window to the maximum sub-window baseline; The sub-window baseline of the subsequent sub-transmission window is increased according to a first preset ratio based on the previous sub-window baseline, and the maximum sub-window baseline is updated until the distance change information indicates that the transmission distance becomes larger.
4. The network traffic control method of the RDMA network card according to claim 2, characterized in that: The reducing the sub-window baseline of the next sub-transmission window based on the transmission state comprises: Obtaining a distance change of the transmission distance; When the distance variation exceeds a preset distance threshold, the sub-window baseline of the next sub-transmission window is reduced according to a second preset ratio; otherwise, the sub-window baseline of the next sub-transmission window is adjusted in combination with the previous transmission state.
5. The network traffic control method of the RDMA network card according to claim 4, characterized in that: The adjusting the sub-window baseline of the next sub-transmission window in combination with the previous transmission state comprises: If the previous transmission state is a good state, adjusting the current transmission state to a poor state; If the previous transmission state is a state difference, the state quantity of the continuous state difference is obtained, and when the state quantity exceeds a preset state threshold, the sub-window baseline of the next sub-transmission window is reduced according to a third preset ratio.
6. The network traffic control method of the RDMA network card according to claim 2, characterized in that: The step of determining, according to the message sequence number of the ACK message, to update the next sub-transmission window comprises: Obtain the sub-transmission window corresponding to the message sequence number of the ACK message, and obtain a minimum sequence number to be confirmed based on the sub-transmission window; When the message sequence number of the ACK message is greater than or equal to the minimum sequence number to be confirmed, it is determined to update the next sub-transmission window.
7. The network traffic control method of the RDMA network card according to claim 2, characterized in that: The step of obtaining, according to the transmission parameters of the data to be transmitted, at least one transmission window and a sub-window baseline of a sub-transmission window of each transmission window comprises: Acquire transmission parameters, where the transmission parameters include one or more of link bandwidth, optical device conversion rate, transmission distance, distance incorporation rate, maximum transmission unit, and number of sub-windows, and there is a first data relationship between the number of sub-windows and the maximum transmission unit; At least one transmission window is calculated according to the transmission parameters, and the sub-window baseline is calculated according to the number of sub-windows.
8. The network traffic control method of the RDMA network card according to claim 7, characterized in that: The updating of the transmission distance based on the ACK message comprises: Acquire the sending timestamp of the information message that the identifier indicates generates the ACK message, and the receiving timestamp of the ACK message; Generate a time difference between the receiving timestamp and the sending timestamp; The transmission distance is calculated based on the time difference and the optical equipment conversion rate.
9. The network traffic control method of the RDMA network card according to claim 1, characterized in that: The step of generating the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window comprises: Querying resource data corresponding to the current sub-transmission window from the window management information; If the resource data exists, adjusting the transmission permission information to a sending state; If the resource data does not exist, generate the resource data, update the information message of the sub-transmission window, and adjust the transmission permission information to a sending state; If the resource data cannot be generated, the transmission permission information is adjusted to a stop state.
10. The network traffic control method of the RDMA network card according to claim 1, characterized in that: The encapsulating at least one information message based on the sub-window baseline comprises: Acquire the data to be transmitted based on the task queue element; Determining data content in the information message according to the sub-window baseline, and generating a message sequence number according to the transmission order of the information message; Based on the message sequence number, taking the first information message of the transmission window and the last information message of each sub-transmission window as the information message to be fed back; The identifier in the information message to be fed back is set to one, and the identifiers of other information messages are set to zero.
11. A network traffic control device for an RDMA network card, characterized in that: include: A parameter calculation module: used for obtaining, in response to a transmission request corresponding to a task queue element, a sub-window baseline of at least one transmission window and a sub-transmission window of each transmission window according to a transmission parameter of the data to be transmitted; The permission acquisition module is used to generate the transmission permission information of the sub-transmission window according to the resource data of the sub-transmission window under the transmission window; A data generation and sending module: used for encapsulating at least one information message based on the sub-window baseline and transmitting the information message to a receiving party when the transmission permission information indicates that the sub-transmission window is in a sending state, wherein the information message includes an identifier for instructing the receiving party to generate a feedback message according to a reception result of the information message; Update module: used for acquiring the feedback message generated by the receiving party, and obtaining the transmission state and the transmission distance according to the feedback message, and updating the sub-window baseline of the next sub-transmission window based on the transmission state and the transmission distance.
12. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the network traffic control method of the RDMA network card according to any one of claims 1 to 10 when executing the computer program.
13. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the network traffic control method of the RDMA network card according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Method and system for calculating dynamic bandwidth of network link
CN102088403A
Window control method and device based on TCP protocol and electronic equipment
CN111371692A
RDMA (Remote Direct Memory Access) network QoS (Quality of Service) coordination method based on user mode
CN116723550A
Message transmission method and device, chip, equipment, storage medium and program product
CN118368248A
Network congestion control method and apparatus for implementing the same
US20240223506A1
Cited By
RoCE flow control method based on protocol stack
CN119996329A
RoCE Flow Control Method Based on Protocol Stack
CN119996329B