Inter-host data transmission method and device based on UDP (User Datagram Protocol) and related equipment
By introducing new fields into UDP packets and utilizing RDMA network cards to complete data transmission, the problem of low UDP transmission efficiency in traditional Ethernet devices is solved, achieving efficient data transmission and cost optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU SHANGHANG INFORMATION TECH CO LTD
- Filing Date
- 2026-03-24
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional Ethernet devices are inefficient when transmitting data via UDP, have a closed ecosystem, and have high hardware costs. Improving data transmission efficiency has become a key concern.
By introducing new fields into UDP packets, including send timestamp information, receive timestamp information, source address, and destination address, the RDMA network card is used to complete the data reading and writing process, reducing CPU relay. Combined with network congestion judgment and bandwidth adjustment, transmission efficiency is optimized.
It improves data transmission efficiency, reduces CPU relay processes, avoids the impact of network congestion on transmission, and reduces hardware costs.
Smart Images

Figure CN121907944A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to a method, apparatus and related equipment for data transmission between hosts based on UDP. Background Technology
[0002] In the current market environment, various solutions based on RDMA technology have accelerated the deployment of large-scale models. However, these solutions typically have closed ecosystems and higher hardware costs compared to Ethernet devices. Traditional Ethernet devices, when transmitting data using the current User Datagram Protocol (UDP), require CPU relay, resulting in lower transmission efficiency compared to other RDMA-based solutions. Therefore, how to improve data transmission efficiency based on UDP within the framework of traditional Ethernet devices has been a persistent concern. Summary of the Invention
[0003] In view of this, this application provides a method, apparatus and related equipment for data transmission between hosts based on UDP, so as to improve data transmission efficiency to a certain extent.
[0004] To achieve the above objectives, the following solution is proposed: A UDP-based data transmission method, comprising: The system receives a User Datagram Protocol (UDP) packet sent by a sending host. The UDP packet includes new fields based on UDP extensions, including: sending timestamp information, receiving timestamp information, source address, and destination address. The sending timestamp information is the time information when the sending host sends the UDP packet. Data is read from the device corresponding to the source address in the UDP packet, and the read data is used as the payload in the UDP packet. The UDP packet is sent to the receiving host together with the receiving host so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, record the receiving timestamp information in the UDP packet, complete the data transmission, and determine the packet loss rate of the data transmission. Determine if the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; If so, the effective bandwidth is determined based on the sending timestamp, receiving timestamp, and payload in the UDP packet; Based on the effective bandwidth and the preset transmission efficiency, the actual bandwidth is calculated. Based on the actual bandwidth, the preset transmission efficiency is adjusted.
[0005] Optionally, the effective bandwidth is determined based on the send timestamp information, receive timestamp information, and payload in the UDP packet, including: The data transmission time is calculated based on the sending and receiving timestamps in the UDP packet. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
[0006] Optionally, based on the actual bandwidth, the preset transmission efficiency can be adjusted, including: Calculate the average real bandwidth based on the stated real bandwidth; Based on the average actual bandwidth, the preset transmission efficiency is adjusted.
[0007] Optionally, network congestion can be determined based on send timestamp information, receive timestamp information, and packet loss rate, including: When the difference between the received timestamp information and the sent timestamp information is greater than a preset transmission time threshold, or when the packet loss rate is greater than a preset packet loss rate threshold, network congestion occurs.
[0008] Optionally, the device includes a graphics processor or non-volatile memory.
[0009] A UDP-based data transmission device, comprising: The message receiving module is used to receive UDP messages sent by the sending host. The UDP message includes new fields based on UDP extensions. The new fields include: sending timestamp information, receiving timestamp information, source address, and destination address. The sending timestamp information is the time information when the sending host sends the UDP message. The data processing module is used to read data from the device corresponding to the source address in the UDP packet, and send the read data as the payload in the UDP packet together with the UDP packet to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, record the receiving timestamp information in the UDP packet, complete the data transmission, and determine the packet loss rate of the data transmission. The network condition judgment module is used to determine whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; if so, it determines the effective bandwidth based on the sending timestamp information, receiving timestamp information, and effective payload in the UDP packet; it calculates the actual bandwidth based on the effective bandwidth and a preset transmission efficiency; and it adjusts the preset transmission efficiency based on the actual bandwidth.
[0010] Optionally, the effective bandwidth is determined based on the send timestamp information, receive timestamp information, and payload in the UDP packet, including: The data transmission time is calculated based on the sending and receiving timestamps in the UDP packet. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
[0011] Optionally, based on the actual bandwidth, the preset transmission efficiency can be adjusted, including: Calculate the average real bandwidth based on the stated real bandwidth; Based on the average actual bandwidth, the preset transmission efficiency is adjusted.
[0012] A UDP-based data transmission device includes: a memory and a processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of a UDP-based data transmission method as described in any of the preceding claims.
[0013] A readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a UDP-based data transmission method as described in any of the preceding claims.
[0014] As can be seen from the above technical solutions, the present application provides a UDP-based data transmission method, apparatus, and related equipment, including: receiving a User Datagram Protocol (UDP) packet sent by a sending host, the UDP packet including new fields based on UDP extensions, the new fields including: sending timestamp information, receiving timestamp information, source address, and destination address, the sending timestamp information being the time information when the sending host sends the UDP packet; reading data from the device corresponding to the source address in the UDP packet, and using the read data as the payload in the UDP packet, sending it together with the UDP packet to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, and record the receiving timestamp information in the UDP packet to complete the data transmission, and determine the packet loss rate of the data transmission; judging whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; if so, determining the effective bandwidth based on the sending timestamp information, receiving timestamp information, and payload in the UDP packet; calculating the actual bandwidth based on the effective bandwidth and a preset transmission efficiency; and adjusting the preset transmission efficiency based on the actual bandwidth. This application utilizes a new field based on UDP extensions in UDP packets, allowing the RDMA network card to handle data transmission. This enables the entire data reading and writing process to be completed by the RDMA network card without CPU intervention, reducing the CPU's role in data transfer and improving data transmission efficiency to some extent. Furthermore, by assessing network congestion and adjusting transmission efficiency accordingly, the impact of network congestion on data transmission can be mitigated to a certain degree. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a UDP-based data transmission method provided in this application embodiment; Figure 2 A schematic diagram of a UDP-based data transmission device provided in an embodiment of this application; Figure 3 This is a hardware structure block diagram of a UDP-based data transmission device provided in an embodiment of this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0018] Figure 1 A flowchart of a UDP-based data transmission method is provided for embodiments of this application. The method may include the following steps: Step S100: Receive the UDP packet sent by the sending host.
[0019] Specifically, UDP packets include new fields based on UDP extensions, including: send timestamp information, receive timestamp information, source address, and destination address.
[0020] The sending timestamp information is the time when the sending host sends the UDP packet. The sending host is responsible for filling in the sending timestamp, and the receiving host fills in the receiving timestamp information when restoring the acknowledgment character after receiving the data. The sending and receiving timestamp information are used to assess network congestion. The source address is used to tell the RDMA network card to read data from the specified address, and the destination address is used to tell the RDMA network card to write data to the specified address.
[0021] Step S101: Read data from the device corresponding to the source address in the UDP packet, and send the read data as the payload in the UDP packet together with the UDP packet to the receiving host.
[0022] Specifically, after receiving a UDP packet, the RDMA network card reads the source address specified in the UDP packet, directly reads the data from the graphics processor or non-volatile memory corresponding to the source address, and sends it as part of the UDP payload to the receiving host. The receiving host then writes the payload into the graphics processor or non-volatile memory corresponding to the destination address in the UDP packet, records the receiving timestamp information in the UDP packet, completes the data transmission, and determines the packet loss rate of the data transmission.
[0023] The data plane transmission is completed by the RDMA network card through the above steps, while the control plane tasks, such as packet encapsulation and decapsulation of the protocol stack, are still completed by the CPU. This allows the data reading and writing process to be completely completed by the RDMA network card without the CPU's involvement, reducing the CPU's relay process and improving the efficiency of data transmission to a certain extent.
[0024] Step S102: Determine whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate.
[0025] Specifically, if the difference between the received timestamp and the sent timestamp is greater than a preset transmission time threshold, or if the packet loss rate is greater than a preset packet loss rate threshold, network congestion can be considered to exist. If network congestion is present, step S103 is executed; otherwise, no operation is required. The packet loss rate threshold can be set to 1%.
[0026] Step S103: Determine the effective bandwidth based on the sending timestamp information, receiving timestamp information, and payload in the UDP packet.
[0027] Step S104: Calculate the actual bandwidth based on the effective bandwidth and the preset transmission efficiency.
[0028] Specifically, the real bandwidth (realBW) can be calculated using the formula: Real Bandwidth (realBW) = Effective Bandwidth (curBW) × Transmission Efficiency (β). Here, transmission efficiency (β) is used as a congestion control factor and is typically set to 0 < β < 1.
[0029] Step S105: Adjust the preset transmission efficiency based on the actual bandwidth.
[0030] The above embodiment provides a UDP-based data transmission method, comprising: receiving a User Datagram Protocol (UDP) packet sent by a sending host, the UDP packet including new fields based on UDP extensions, the new fields including: sending timestamp information, receiving timestamp information, source address, and destination address, the sending timestamp information being the time information when the sending host sends the UDP packet; reading data from the device corresponding to the source address in the UDP packet, and using the read data as the payload in the UDP packet, sending it together with the UDP packet to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, and record the receiving timestamp information in the UDP packet to complete the data transmission, and determine the packet loss rate of the data transmission; determining whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; if so, determining the effective bandwidth based on the sending timestamp information, receiving timestamp information, and payload in the UDP packet; calculating the actual bandwidth based on the effective bandwidth and a preset transmission efficiency; and adjusting the preset transmission efficiency based on the actual bandwidth. This application utilizes a new field based on UDP extensions in UDP packets, allowing the RDMA network card to handle data transmission. This enables the entire data reading and writing process to be completed by the RDMA network card without CPU intervention, reducing the CPU's role in data transfer and improving data transmission efficiency to some extent. Furthermore, by assessing network congestion and adjusting transmission efficiency accordingly, the impact of network congestion on data transmission can be mitigated to a certain degree.
[0031] In some embodiments of this application, step S103, determining the effective bandwidth based on the sending timestamp information, receiving timestamp information, and payload in the UDP packet, may include: S11. Calculate the data transmission time based on the sending and receiving timestamps in the UDP packet.
[0032] Specifically, based on the send timestamp T1 and receive timestamp T2 in the UDP packet, the data transfer time (RTT) can be calculated by subtracting the send timestamp T1 from the receive timestamp T2.
[0033] S12. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
[0034] Specifically, based on the data transmission time (RTT) and the payload, the effective bandwidth (curBW) can be calculated using the formula curBW = payload / RTT.
[0035] In some embodiments of this application, step S105, adjusting the preset transmission efficiency based on the actual bandwidth, may include: S21. Based on the actual bandwidth, the average actual bandwidth is calculated using a moving average algorithm.
[0036] Specifically, based on the real bandwidth realBW, the average real bandwidth BW can be calculated using the following formula:
[0037] Where N is the size of the sliding window, i.e. the number of samples, which is the number of recent bandwidth measurements used to calculate the average value. To reduce the impact of network jitter, N can be 15; i is the index, which takes values from 1 to N, representing each sample.
[0038] S22. Adjust the preset transmission efficiency based on the average actual bandwidth.
[0039] Specifically, the congestion level is determined by the average real bandwidth. When congestion is severe, the transmission efficiency β is significantly reduced, and when congestion is relieved, the transmission efficiency β is slowly adjusted.
[0040] The following describes the UDP-based data transmission apparatus provided in the embodiments of this application. The UDP-based data transmission apparatus described below can be referred to in correspondence with the UDP-based data transmission method described above.
[0041] Figure 2 This application provides a schematic diagram of a UDP-based data transmission device, which may include: The message receiving module 10 is used to receive UDP messages sent by the sending host. The UDP message includes new fields based on UDP extensions. The new fields include: sending timestamp information, receiving timestamp information, source address and destination address. The sending timestamp information is the time information when the sending host sends the UDP message. The data processing module 20 is used to read data from the device corresponding to the source address in the UDP packet, and send the read data as the payload in the UDP packet together with the UDP packet to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, record the receiving timestamp information in the UDP packet, complete the data transmission, and determine the packet loss rate of the data transmission. The network condition judgment module 30 is used to determine whether the network is congested based on the sending timestamp information, receiving timestamp information and packet loss rate; if so, it determines the effective bandwidth based on the sending timestamp information, receiving timestamp information and effective payload in the UDP packet; it calculates the real bandwidth based on the effective bandwidth and the preset transmission efficiency; and it adjusts the preset transmission efficiency based on the real bandwidth.
[0042] The above embodiment provides a UDP-based data transmission device, comprising: a message receiving module 10, used to receive UDP messages sent by a sending host, the UDP message including new fields based on UDP extensions, the new fields including: sending timestamp information, receiving timestamp information, source address, and destination address, the sending timestamp information being the time information when the sending host sends the UDP message; a data processing module 20, used to read data from the device corresponding to the source address in the UDP message, and use the read data as the payload in the UDP message, sending it together with the UDP message to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP message, record the receiving timestamp information in the UDP message, complete the data transmission, and determine the packet loss rate of the data transmission; a network condition judgment module 30, used to determine whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; if so, determine the effective bandwidth based on the sending timestamp information, receiving timestamp information, and payload in the UDP message; calculate the actual bandwidth based on the effective bandwidth and a preset transmission efficiency; and adjust the preset transmission efficiency based on the actual bandwidth. This application utilizes a new field based on UDP extensions in UDP packets, allowing the RDMA network card to handle data transmission. This enables the entire data reading and writing process to be completed by the RDMA network card without CPU intervention, reducing the CPU's role in data transfer and improving data transmission efficiency to some extent. Furthermore, by assessing network congestion and adjusting transmission efficiency accordingly, the impact of network congestion on data transmission can be mitigated to a certain degree.
[0043] Optionally, the network condition assessment module 30 may perform a process of determining the effective bandwidth based on the send timestamp information, receive timestamp information, and payload in the UDP packet, which may include: The data transmission time is calculated based on the send and receive timestamps in the UDP packet. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
[0044] Optionally, the network condition assessment module 30 may perform a process of adjusting the preset transmission efficiency based on the actual bandwidth, which may include: Calculate the average real bandwidth based on the actual bandwidth. The transmission efficiency is adjusted based on the average actual bandwidth.
[0045] This application also provides a UDP-based data transmission device. Figure 3 A hardware block diagram of a UDP-based data transmission device is shown. (Refer to...) Figure 3 The hardware structure of a UDP-based data transmission device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4. In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4; Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device; The memory stores a program, which the processor can call. The program is used to implement the various processing flows in the aforementioned UDP-based data transmission method.
[0046] This application embodiment also provides a storage medium that can store a program suitable for processor execution, the program being used to implement the various processing flows in the aforementioned UDP-based data transmission method.
[0047] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0048] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined with each other, and the same or similar parts can be referred to each other.
[0049] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data transmission method based on UDP, characterized in that, include: The system receives a User Datagram Protocol (UDP) packet sent by a sending host. The UDP packet includes new fields based on UDP extensions, including: sending timestamp information, receiving timestamp information, source address, and destination address. The sending timestamp information is the time information when the sending host sends the UDP packet. Data is read from the device corresponding to the source address in the UDP packet, and the read data is used as the payload in the UDP packet. The UDP packet is sent to the receiving host together with the receiving host so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, record the receiving timestamp information in the UDP packet, complete the data transmission, and determine the packet loss rate of the data transmission. Determine if the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; If so, the effective bandwidth is determined based on the sending timestamp information, receiving timestamp information, and payload in the UDP packet; Based on the effective bandwidth and the preset transmission efficiency, the actual bandwidth is calculated. Based on the actual bandwidth, the preset transmission efficiency is adjusted.
2. The method according to claim 1, characterized in that, Based on the send timestamp information, receive timestamp information, and payload in the UDP packet, the effective bandwidth is determined, including: The data transmission time is calculated based on the sending and receiving timestamps in the UDP packet. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
3. The method according to claim 1, characterized in that, Based on the actual bandwidth, the preset transmission efficiency is adjusted, including: Calculate the average real bandwidth based on the stated real bandwidth; Based on the average actual bandwidth, the preset transmission efficiency is adjusted.
4. The method according to claim 1, characterized in that, Based on send timestamp information, receive timestamp information, and packet loss rate, determine whether the network is congested, including: When the difference between the received timestamp information and the sent timestamp information is greater than a preset transmission time threshold, or when the packet loss rate is greater than a preset packet loss rate threshold, network congestion occurs.
5. The method according to claim 1, characterized in that, The device includes: a graphics processor or non-volatile memory.
6. A UDP-based data transmission device, characterized in that, include: The message receiving module is used to receive UDP messages sent by the sending host. The UDP message includes new fields based on UDP extensions. The new fields include: sending timestamp information, receiving timestamp information, source address, and destination address. The sending timestamp information is the time information when the sending host sends the UDP message. The data processing module is used to read data from the device corresponding to the source address in the UDP packet, and send the read data as the payload in the UDP packet together with the UDP packet to the receiving host, so that the receiving host can write the payload into the device corresponding to the destination address in the UDP packet, record the receiving timestamp information in the UDP packet, complete the data transmission, and determine the packet loss rate of the data transmission. The network condition judgment module is used to determine whether the network is congested based on the sending timestamp information, receiving timestamp information, and packet loss rate; if so, it determines the effective bandwidth based on the sending timestamp information, receiving timestamp information, and effective payload in the UDP packet; it calculates the actual bandwidth based on the effective bandwidth and a preset transmission efficiency; and it adjusts the preset transmission efficiency based on the actual bandwidth.
7. The apparatus according to claim 6, characterized in that, Based on the send timestamp information, receive timestamp information, and payload in the UDP packet, the effective bandwidth is determined, including: The data transmission time is calculated based on the sending and receiving timestamps in the UDP packet. The effective bandwidth is calculated based on the data transmission time and the payload in the UDP packet.
8. The apparatus according to claim 6, characterized in that, Based on the actual bandwidth, the preset transmission efficiency is adjusted, including: Calculate the average real bandwidth based on the stated real bandwidth; Based on the average actual bandwidth, the preset transmission efficiency is adjusted.
9. A UDP-based data transmission device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the UDP-based data transmission method as described in any one of claims 1-5.
10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the various steps of the UDP-based data transmission method as described in any one of claims 1-5.
Citation Information
Patent Citations
Method for predicting UDP congestion degree by utilizing message number and message timestamp
CN109361566A
Network congestion control method and device
CN111817977A
Network optimization system and method for distributed machine learning, and electronic equipment
CN116266826A
Network congestion control method, sending end network card and receiving end network card
CN119788619A