CN120614089A - Data transmission method, device, equipment, system, storage medium and program product - Google Patents
Data transmission method, device, equipment, system, storage medium and program productInfo
- Publication number
- CN120614089A CN120614089A CN202410258299.4A CN202410258299A CN120614089A CN 120614089 A CN120614089 A CN 120614089A CN 202410258299 A CN202410258299 A CN 202410258299A CN 120614089 A CN120614089 A CN 120614089A
- Authority
- CN
- China
- Prior art keywords
- packet
- data
- data packet
- sequence number
- network card
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Communication Control (AREA)
Abstract
The application discloses a data transmission method, a device, equipment, a system, a storage medium and a program product, and relates to the technical field of communication. The first network card of the first device receives a first data packet of a first data stream sent by the second device, the first data packet carries a packet sequence number and a source end storage position, the source end storage position of the first data packet is a storage position of a load of the first data packet on the second device, transmission information of the first data stream recorded on the first network card is updated based on the first data packet, the transmission information comprises a packet sequence number of a first tail packet and the source end storage position of the first tail packet, the first tail packet is the last data packet in a first data packet interval, the transmission information is used for realizing packet loss retransmission of the first data stream, and the load of the first data packet is written into a storage module of the first device. According to the method, selective retransmission based on the network card can be realized by recording the transmission information of the data stream, so that the data retransmission overhead is reduced, and the data transmission efficiency is improved.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, apparatus, device, system, storage medium, and program product.
Background
With the increasing data transmission performance requirements in communication networks, remote direct memory access (remote direct memory access, RDMA) technology has evolved rapidly, wherein RDMA technology network cards enable data to be moved directly from the memory of one device to the memory of another device. Because the packet loss phenomenon may occur in the data transmission process, the packet loss may cause incomplete data received by the receiving end, so that the lost data packet needs to be retransmitted to ensure the integrity of the data received by the receiving end.
In the related art, due to the constraint of the processing capacity of the network card, a packet loss retransmission mechanism of a back-off-N-frames (GBN) algorithm is adopted to ensure the integrity of data transmission. For example, the transmitting end maintains unacknowledged frames, and when an error such as packet loss occurs, retransmits from the error frame, that is, retransmits the error frame and frames subsequent to the error frame until all frames are acknowledged.
However, the backoff N frame algorithm adopted by RDMA may cause too large retransmission overhead, and the transmission efficiency is low, so that the data transmission requirement cannot be met.
Disclosure of Invention
The application provides a data transmission method, a device, equipment, a system, a storage medium and a program product, which are used for improving data transmission efficiency.
In a first aspect, the present application provides a data transmission method, where the method is applied to a first network card included in a first device. The first network card receives a first data packet sent by a second device, wherein the first data packet carries a packet sequence number and a source end storage position, the source end storage position of the first data packet is a storage position of a load of the first data packet on the second device, the first data packet belongs to a first data stream, the first network card updates transmission information of the first data stream recorded on the first network card based on the first data packet, the transmission information comprises a packet sequence number of a first tail packet and the source end storage position of the first tail packet, the first tail packet is the last data packet in a first data packet interval, the transmission information is used for realizing packet loss retransmission of the first data stream, and the first network card writes the load of the first data packet into a storage module of the first device.
In the method, the source storage position is carried in the transmitted data packet, so that the first network card can record the source storage position of the first tail packet in the transmission information, and then the source storage position of the lost data packet can be determined based on the source storage position of the first tail packet under the condition of packet loss, and further selective retransmission is realized based on the network card. In addition, the transmission information recorded in the network card is the packet sequence number of the first tail packet and the source end storage position of the first tail packet, so that the additional overhead introduced by recording the transmission information is small and is not limited by the limited space of the network card, and the transmission information recorded by the size of the data stream is the packet sequence number of the first tail packet and the source end storage position of the first tail packet, so that the additional overhead is constant and cannot be increased along with the increase of the data packets of the data stream. The method can realize efficient and reliable selective retransmission by utilizing a smaller network card space.
In one possible implementation manner, before the first network card updates the transmission information of the first data stream recorded on the first network card based on the first data packet, the first network card further comprises sending a first retransmission request to the second device when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, the first retransmission request indicates the packet sequence number of the first lost data packet and the source end storage position, the packet sequence number of the first lost data packet is the packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the first data packet, the source end storage position of the first lost data packet is the storage position between the source end storage position of the first tail packet and the source end storage position of the first data packet, and the first retransmission request is used for retransmitting the first lost data packet by the second device.
In this manner, the source storage location indicated in the first retransmission request enables the second device to retrieve the first missing data packet and retransmit the first missing data packet. Therefore, the first retransmission request is sent to the second device through the first network card, so that the lost data packet can be ensured to be retransmitted, the integrity and the continuity of the data stream are maintained, and the reliability of the data transmission is improved.
In one possible implementation manner, the first device further comprises a first processor, and before the first network card updates the transmission information of the first data stream recorded on the first network card based on the first data packet, the first network card sends packet loss information of the first data stream to the first processor under the condition that the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, wherein the packet loss information is used for realizing packet loss retransmission of the first data stream by the first processor, and the packet loss information comprises the packet sequence number of the first tail packet, the source storage position of the first tail packet, the packet sequence number of the first data packet and the source storage position of the first data packet.
In this way, the first network card may send the packet loss information to the first processor, so that the processing and decision of the packet loss may be completed on the first processor. The first network card sends the packet loss information to the first processor for processing, so that complex packet loss processing on the network card is avoided, and the retransmission processing burden of the network card can be reduced.
In one possible implementation manner, the first device further comprises a first processor, after the first network card sends the first retransmission request to the second device, the first device further comprises a first network card receiving a retransmission data packet, wherein the retransmission data packet comprises at least one data packet in a first lost data packet sent by the second device, and the first network card sends the retransmission data packet to the first processor, and the first network card is used for writing a load of the retransmission data packet into a storage module of the first device.
In this way, the processor has a stronger computing power than the network card, so that the retransmission data packet can be accurately stored in the designated position of the first memory. Thus, a selective retransmission mechanism combining hardware (i.e., network card) and software is realized by a processor running the software.
In one possible implementation manner, after the first network card sends the retransmission data packet to the first processor, the method further comprises the step that the first network card sends a second retransmission request to the second device, the second retransmission request is generated by the first processor when packet loss information of the first data stream stored by the first processor is updated according to a packet sequence number of the retransmission data packet, the updated packet loss information indicates that the first data stream has a second lost data packet, the second retransmission request indicates a packet sequence number of the second lost data packet and a source end storage position of the second lost data packet, and the second retransmission request is used for the second device to retransmit the second lost data packet.
In this manner, the first processor can determine whether the first data stream has packet loss according to the packet sequence number of the retransmission data packet, and if the first data stream has packet loss, a second retransmission request can be generated to continuously request the second device to perform packet loss retransmission, so as to ensure the integrity of the data stream.
In one possible implementation manner, the first network card further sends a third retransmission request to the second device, the third retransmission request is generated by the first processor when the packet loss information stored by the first processor exceeds a first threshold time and the stored packet loss information indicates that the third lost data packet exists in the first data stream, the third retransmission request indicates a packet sequence number and a source storage location of the third lost data packet, and the third retransmission request is used for the second device to retransmit the third lost data packet.
In this manner, the first processor can determine whether the first data stream has packet loss according to the update condition of the packet loss information of the first data stream, and if the first data stream has packet loss, a third retransmission request can be generated to continuously request the second device to perform packet loss retransmission, so as to ensure the integrity of the data stream. The first threshold time can be flexibly configured according to different application scenes and requirements. For example, in the case where the network environment is poor or the data transmission requirement is high, the first threshold time may be appropriately reduced to improve the reliability of the data transmission.
In one possible implementation manner, the first network card updates the transmission information of the first data stream recorded on the first network card based on the first data packet, wherein the first network card updates the packet sequence number and the source storage position of the first tail packet in the transmission information to be the packet sequence number and the source storage position of the first data packet when the packet sequence number of the first data packet is continuous with the packet sequence number of the first tail packet, or updates the packet sequence number and the source storage position of the first tail packet in the transmission information to be the packet sequence number and the source storage position of the first data packet when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, or adds the packet sequence number and the source storage position of the second tail packet to be the last data packet in the second data packet interval when the packet sequence number and the source storage position of the second tail packet are discontinuous.
The above-mentioned mode for updating the transmission information provides two modes for updating the transmission information for the situation that the packet sequence number of the first data packet and the packet sequence number of the first tail packet are discontinuous, thereby enriching the recording mode of the transmission information. The transmission information is updated based on the received first data packet such that the transmission information indicates a condition of the latest received first data stream. Therefore, the accuracy of the transmission information can be ensured by the mode of updating the transmission information. In addition, for the mode of updating the transmission information, the mode of recording the packet sequence number of the second tail packet and the source end storage position of the second tail packet is added, and no matter how the transmission information recorded by the data stream size is the packet sequence number of the first tail packet and the source end storage position of the first tail packet and the packet sequence number of the second tail packet and the source end storage position of the second tail packet, the additional overhead introduced by recording the transmission information is small and is constant.
In one possible implementation manner, when the first processor of the first device receives packet loss information of the first data stream sent by the first network card, the first network card receives a release message sent by the first processor, and releases a storage space of a packet sequence number of a first tail packet based on the release message, where the released storage space is used to record a packet sequence number of a third tail packet, and the third tail packet is a last data packet in a third data packet interval with continuous packet sequence numbers after the received second data packet interval.
In the mode, the storage space of the information reported to the processor is released, and the released storage space is used for storing the subsequent transmission information again, so that the storage space can be efficiently utilized, and unnecessary occupation of the storage space is avoided.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol. The method can be applied to an RDMA data transmission scene, and data reliable transmission in the RDMA data transmission scene is realized.
In a second aspect, the present application provides a data transmission method, where the method is applied to a second network card included in a second device. The second network card obtains the load of a first data stream in a storage module of the second device, generates a first data packet based on the load, wherein the first data packet carries a packet sequence number and a source end storage position, the source end storage position of the first data packet is the storage position of the load of the first data packet on the second device, and the second network card sends the first data packet to the first device.
In one possible implementation manner, after the second network card sends the first data packet to the first device, the method further comprises the steps that the second network card receives a first retransmission request sent by the first device, the first retransmission request indicates a packet sequence number and a source end storage position of the first lost data packet, the second network card obtains a load of the first lost data packet in a storage module of the second device based on the source end storage position of the first lost data packet, the first lost data packet is generated based on the load of the first lost data packet and the packet sequence number of the first lost data packet, and the second network card sends the first lost data packet to the first device.
In one possible implementation, after the second network card sends the first data packet to the first device, the method further includes if the first data packet is a tail packet of the first data stream and the first data packet is not acknowledged within a second threshold time after sending the first data packet, and the second network card sends the first data packet to the first device again.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol.
In a third aspect, there is provided a data transmission apparatus applied to a first network card included in a first device, the apparatus comprising:
The first receiving module is used for receiving a first data packet sent by the second device, wherein the first data packet carries a packet sequence number and a source end storage position, the source end storage position of the first data packet is a storage position of a load of the first data packet on the second device, and the first data packet belongs to a first data stream;
the recording module is used for updating the transmission information of the first data stream recorded on the first network card based on the first data packet, wherein the transmission information comprises the packet sequence number of a first tail packet and the source end storage position of the first tail packet, the first tail packet is the last data packet in the first data packet interval, and the transmission information is used for realizing packet loss retransmission of the first data stream;
and the writing module is used for writing the load of the first data packet into the storage module of the first device.
In one possible implementation, the device further includes a first sending module, configured to send a first retransmission request to the second device when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, where the first retransmission request indicates the packet sequence number of the first lost data packet and the source storage location, the packet sequence number of the first lost data packet is the packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the first data packet, the source storage location of the first lost data packet is a storage location between the source storage location of the first tail packet and the source storage location of the first data packet, and the first retransmission request is used for the second device to retransmit the first lost data packet.
In a possible implementation manner, the device further comprises a second sending module, configured to send packet loss information of the first data stream to the first processor when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, where the packet loss information is used for the first processor to implement packet loss retransmission of the first data stream, and the packet loss information includes the packet sequence number of the first tail packet, the source storage location of the first tail packet, the packet sequence number of the first data packet, and the source storage location of the first data packet.
In one possible implementation, the receiving module is further configured to receive a retransmission packet, where the retransmission packet includes at least one packet of the first missing data packet sent by the second device, and the second sending module is further configured to send the retransmission packet to the first processor, where the first processor writes a load of the retransmission packet to the storage module of the first device.
In one possible implementation manner, the first sending module is further configured to send a second retransmission request to the second device, where the second retransmission request is generated by the first processor when the packet loss information of the first data stream stored by the first processor is updated according to the packet sequence number of the retransmission data packet, and the updated packet loss information indicates that the first data stream has the second lost data packet, and the second retransmission request indicates the packet sequence number of the second lost data packet and the source storage location of the second lost data packet, and the second retransmission request is used for the second device to retransmit the second lost data packet.
In one possible implementation manner, the first sending module is further configured to send a third retransmission request to the second device, where the third retransmission request is generated by the first processor when the packet loss information stored by the first processor exceeds a first threshold time and the stored packet loss information indicates that the first data stream has a third lost packet, and the third retransmission request indicates a packet sequence number and a source storage location of the third lost packet, and the third retransmission request is used for the second device to retransmit the third lost packet.
In one possible implementation manner, the recording module is configured to update the packet sequence number and the source storage location of the first tail packet in the transmission information to the packet sequence number and the source storage location of the first data packet when the packet sequence number of the first data packet is consecutive to the packet sequence number of the first tail packet.
In one possible implementation manner, the recording module is configured to update the packet sequence number and the source storage location of the first tail packet in the transmission information to the packet sequence number and the source storage location of the first data packet when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet.
In one possible implementation manner, the recording module is configured to increase and record, in the transmission information, a packet sequence number of the second tail packet and a source storage location of the second tail packet, where the second tail packet is a last packet in the second packet interval, and the packet sequence number and the source storage location of the second tail packet are the packet sequence number and the source storage location of the first packet, where the packet sequence number of the first packet is discontinuous with the packet sequence number of the first tail packet.
In one possible implementation manner, the device further comprises a second receiving module, a releasing module and a releasing module, wherein the second receiving module is used for receiving a releasing message sent by the first processor when the first processor of the first device receives packet loss information of a first data stream sent by the first network card, the releasing module is used for releasing a storage space of a packet sequence number of a first tail packet based on the releasing message, the released storage space is used for recording a packet sequence number of a third tail packet, and the third tail packet is the last data packet in a third data packet interval with continuous packet sequence numbers after the received second data packet interval.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol.
In a fourth aspect, a data transmission apparatus is provided, which is applied to a second network card included in a second device. The device comprises:
The generating module is used for acquiring the load of the first data flow in the storage module of the second device, generating a first data packet based on the load, wherein the first data packet carries a packet sequence number and a source end storage position, and the source end storage position of the first data packet is the storage position of the load of the first data packet on the second device;
And the sending module is used for sending the first data packet to the first equipment.
In one possible implementation manner, the device further comprises a receiving module, a generating module and a transmitting module, wherein the receiving module is used for receiving a first retransmission request sent by the first device, the first retransmission request indicates a packet sequence number and a source end storage position of a first lost data packet, the generating module is further used for acquiring a load of the first lost data packet in a storage module of the second device based on the source end storage position of the first lost data packet, and generating the first lost data packet based on the load of the first lost data packet and the packet sequence number of the first lost data packet, and the transmitting module is further used for sending the first lost data packet to the first device.
In one possible implementation manner, the sending module is further configured to send the first data packet to the first device again if the first data packet is a tail packet of the first data stream and the first data packet is not acknowledged within a second threshold time after the first data packet is sent.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol.
In a fifth aspect, a data transmission system is provided, where the system includes a first device and a second device, where the first device includes a first network card for performing the data transmission method in the first aspect or any of the possible implementation manners of the first aspect, and the second device includes a second network card for performing the data transmission method in the second aspect or any of the possible implementation manners of the second aspect.
In a sixth aspect, there is provided a computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to cause a computer to implement the data transmission method of the above aspects.
In a seventh aspect, a computer program (product) is provided which, when executed by a computer, can cause the processor or the computer to perform the data transmission method in the above aspects.
In an eighth aspect, there is provided a chip including a processor for calling from a memory and executing instructions stored in the memory, so that a computer on which the chip is mounted performs the data transmission method in the above aspects.
In a ninth aspect, there is provided another chip comprising an input interface, an output interface, a processor and a memory, the input interface, the output interface, the processor and the memory being connected by an internal connection path, the processor being configured to execute a code in the memory, the code when executed causing a computer on which the chip is mounted to perform the data transmission method of the above aspects.
It should be appreciated that the technical solutions of the second aspect to the ninth aspect and the corresponding possible embodiments of the present application may refer to the technical effects of the first aspect and the corresponding possible embodiments of the first aspect, which are not described herein.
Drawings
Fig. 1 is a schematic diagram of a data transmission process according to an embodiment of the present application;
fig. 2 is a schematic diagram of an implementation environment of a data transmission method according to an embodiment of the present application;
Fig. 3 is a flowchart of a data transmission method according to an embodiment of the present application;
Fig. 4 is a schematic diagram of a system structure for data transmission according to an embodiment of the present application;
fig. 5 is a schematic diagram of a data transmission scenario provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a data transmission device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of another data transmission device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a network device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of another network device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
With the wide application of big data and artificial intelligence, the data volume generated by application running is continuously increasing, and the demands on network bandwidth and throughput are also continuously increasing. In order to meet the requirements of continuously improving network bandwidth and throughput, the performance requirements of data transmission in a communication network are continuously improved, and the development of RDMA technology is promoted. RDMA technology realizes the direct transmission of data from the memory of a source device to the memory of a target device by offloading the network protocol stack and the data packet processing logic to Network INTERFACE CARD (NIC) hardware, thus relieving the pressure of network protocol processing on the device. Wherein, offloading refers to implementing an algorithm or logic originally running on a software end on hardware for more efficient running efficiency. The hardware is a network card, and the software end is a processor running software.
For example, taking the storage module of the first device as the first memory and the storage module of the second device as the second memory as an example, referring to a schematic diagram of a data transmission process shown in fig. 1, the second network card 121 of the second device 120 reads data to be transmitted in the second memory 122, the second network card 121 directly sends the data to be transmitted to the first network card 111 of the first device 110, and the first network card 111 writes the data to be transmitted into the first memory 112 after receiving the data to be transmitted. The data to be transmitted in the process shown in fig. 1 does not need to be processed by an operating system, so that the cost of CPU software is reduced. Because the packet loss phenomenon may occur in the data transmission process, the packet loss may cause incomplete data received by the receiving end, so that the lost data packet needs to be retransmitted to ensure that the receiving end receives complete data.
The packet loss retransmission mechanism mainly comprises GBN and selective retransmission (SELECTIVE RETRANSMIT, SR). The GBN retransmission mechanism is that when a transmitting end determines that an error such as a packet loss occurs in a transmitted packet, all packets are retransmitted from the packet in which the error occurs and after the packet in which the error occurs. The SR mechanism is that the transmitting end only retransmits the data packet with the error when determining that the error such as the data packet loss occurs in the transmitted data packet.
RDMA defaults to a GBN (guaranteed bit stream) algorithm packet loss retransmission mechanism to ensure the integrity of data transmission due to the constraint of the processing capacity of the network card. In the data transmission scenario inside the data center, the packet loss rate is generally low, so the retransmission overhead caused by GBN is small. However, data centers are geographically distributed at different locations, there is a need for data movement between devices that are geographically remote from each other, and there is a need for data movement for services operated by the data centers to communicate across the data centers. Therefore, due to the fact that the packet loss rate on the transmission links between the data centers is high, retransmission overhead caused by GBN is too large, and transmission efficiency is reduced.
Taking an RDMA data transmission scenario with a long distance and a large bandwidth as an example, the long distance makes the delay from end to end larger, and it is difficult for a receiving end to timely feed back packet loss information to a transmitting end, which results in untimely retransmission adjustment of the transmitting end and causes a large number of repeated transmissions. Furthermore, since RDMA stores or reads data in memory in a direct memory access (direct memory access, DMA) manner each time data is transferred, constant retransmission due to GBN occupies a large amount of peripheral device interconnect express (PERIPHERAL COMPONENT INTERCONNECT EXPRESS, PCIe) resources. Among them, the long-distance, large-bandwidth scene may be referred to as a delay-and-delay production (BDP) scene, and PCIe is a high-speed serial computer expansion bus standard.
The improved version of the related art is based on a remote direct memory access network card (improved RDMA over converged ETHERNET NIC, IRN) and a selective retransmission network card (SELECTIVE RETRANSMISSION NETWORK INTERFACE CARD, SRNIC) which are integrated with ethernet, records whether the data packet is accumulatively acknowledged or selectively acknowledged through a bitmap (bitmap) to attempt to modify the GBN algorithm in RDMA processing logic to SR algorithm. The IRN maintains the bitmap of each data stream on the network card of the transmitting end, and SRNIC uploads the bitmap maintained for each data stream to the host for processing of packet loss logic.
However, in a delay-and-bandwidth-product (BDP) scenario, since a long-distance link means more in-transit packets, a very large bitmap is required to buffer the state of the in-transit packets. The IRN places the bitmap on the network card, but the network card without the cache architecture does not have enough hardware space to maintain a long bitmap data structure. SRNIC upload bitmaps of the data streams to the host for maintenance, but in a large BDP scenario, when the number of data streams increases, the memory space for maintaining bitmaps increases dramatically.
The embodiment of the application provides a data transmission method which can realize the reliable transmission of RDMA by using a smaller hardware space. The method can be applied to any RDMA data transfer scenario, for example, to long-range, high-bandwidth RDMA data transfer scenarios. The embodiment of the application is illustrated by taking an RDMA scene as an example, and besides the RDMA scene, the method can also realize SR under the cooperative scene of other software and hardware. For example, a set of independent transmission protocol frames is rebuilt, and the SR of the cooperation of the software and the hardware is realized by adopting the method provided by the embodiment of the application in the transmission protocol frames.
Referring to fig. 2, fig. 2 is a schematic diagram of an implementation environment of a data transmission method according to an embodiment of the present application. The implementation environment comprises a plurality of devices, and any device is a server with data transmission requirements for installing at least one RDMA-supporting network card in a PCIe mode. The different devices may be connected by wired or wireless means, for example, a wired physical connection is formed by at least one intermediate device, which may be a network relay device, a forwarding device, a router, a switch, or the like.
Optionally, the network card includes, but is not limited to, an intelligent network card, a data processing unit (data processing unit, DPU) or RDMA network card, and the server includes, but is not limited to, a computing server, a storage server, a gateway, or the like. The network card in the embodiment of the application can be realized by hardware based on an Application SPECIFIC INTEGRATED Circuit (ASIC) or a field-programmable gate array (FPGA) and the like, or realized by cooperating with a network card driver based on the ASIC or the FPGA.
Referring to fig. 3, fig. 3 is an interaction schematic diagram of a data transmission method according to an embodiment of the present application. The method is described by taking the interactive execution of the first device and the second device as an example, wherein the first device comprises a first network card, and the second device comprises a second network card. Alternatively, the method may be applied in the implementation environment shown in fig. 2, for example, the first device may be the first device 110 shown in fig. 1, the second device may be the second device 120 shown in fig. 1, or the first device and the second device may be any two connected devices shown in fig. 2. As shown in fig. 3, taking the example of the second device sending a first data stream to the first device, the method includes, but is not limited to, the following steps 301-305.
Step 301, a second network card of the second device obtains a load of a first data stream in a storage module of the second device, generates a first data packet based on the load, where the first data packet carries a packet sequence number and a source storage location, and the source storage location of the first data packet is a storage location of the load of the first data packet on the second device.
The second network card of the second device sends data to the first device in the form of data packets, i.e. data packets are data units sent from the second network card of the second device to the first network card of the first device. In the communication process, data is divided into a plurality of data packets for transmission, and the data is transmitted in the form of the data packets, so that the efficiency and the reliability of data transmission can be improved. Each data packet has a unique sequence number, called the packet sequence number. The packet sequence numbers are used for identifying the sequence of the data packets, so that the receiving end can acquire the data according to the correct sequence, and the packet sequence numbers are usually continuously increased, so that the receiving end can continuously determine whether the data packets are lost or not according to the packet sequence numbers.
The source storage location refers to a storage location of a data packet on a sending end, and in the embodiment of the application, the sending end is the second device. That is, the source storage location is used to indicate the source location of the data packet in the sender device, and when the lost data packet needs to be retransmitted, the sender may obtain the data of the lost data packet according to the source storage location and retransmit the data. Alternatively, the source storage location may include at least one of a memory address or an offset. The memory address in the embodiment of the application can be a work queue element (work queue element, WQE), and the offset can be an offset field in the WQE.
In the embodiment of the application, the storage module of the first device is used for storing the load of the first device, and the storage module of the second device is used for storing the load of the second device. The embodiment of the application does not limit the type of the storage module, for example, the storage module can be a memory, a cache and the like.
Illustratively, before the second network card of the second device obtains the load of the first data stream in the storage module of the second device, the first device and the second device apply for a Queue Pair (QP), that is, pair of a transmit queue and a receive queue. In RDMA communications, QP is used to provide a logical connection for data transfer between a first device and a second device, the second device sending data through a send queue, the first device receiving data through a receive queue. After the first device and the second device perform QP, the application program creates corresponding WQEs according to the data transmitted or received as required, and issues the WQEs to the corresponding work queues.
Wherein the application of the second device creates a WQE for sending data and issues the WQE for sending data into the sending queue, the WQE for sending data containing information required for sending data, such as the location of the load, etc. The application of the first device creates a WQE for receiving data and issues the WQE for receiving data into a receive queue, the WQE for receiving data containing information required for receiving data, e.g., a storage location of a received load on the first device, etc.
After the application programs of the first device and the second device issue the WQEs respectively, the second network card of the second device obtains data to be sent from the storage module of the second device in a direct memory access (direct memory access, DMA) mode. The second network card splits data to be sent into a plurality of data packets according to a network protocol. The process of splitting the data into a plurality of data packets by the second network card comprises splitting the data into a plurality of data packets, assigning a packet sequence number to each data packet and loading corresponding to each data packet in a storage position of the second device, wherein the loading corresponding to each data packet comprises WQE and a WQE internal offset field in the storage position of the second device. The WQE and the offset field in the WQE are the source storage locations in the embodiment of the application.
Illustratively, taking sending the first file as an example, the load of the first file is in the storage module of the second device. The second network card directly reads the load of the first file from the storage module of the second device through a DMA technology, the read load is split into a plurality of data packets, each data packet correspondingly generates a data packet transmitted through the RDMA technology, the generated data packet comprises a packet sequence number, WQE and WQE internal offset fields are added in the data packet in the process of generating the data packet, and the WQE and WQE internal offset fields can indicate the storage position of the load of the data packet on the second device.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol. The RDMA protocol is a network communication protocol that allows applications to transfer data directly between the memory of two devices without going through the operating systems of the two devices, thereby improving the performance and efficiency of the data transfer. RDMA protocol-based data transmission can be applied to application scenarios of high-speed and low-delay data transmission, such as distributed computing, large-scale data storage, real-time data analysis and the like. Implementation of RDMA protocol requires support of hardware that requires a network card supporting RDMA functions. In an embodiment of the application, the first device and the second device both support RDMA protocols.
In step 302, the second network card of the second device sends a first data packet to the first device.
The second network card of the second device sends the data packets to the first network card of the first device in sequence, illustratively in the order of the packet numbers of the data packets. The second network card of the second device and the first network card of the first device may be connected by a wired or wireless manner. In one possible implementation, after the second network card sends the first data packet to the first device, the method further includes if the first data packet is a tail packet of the first data stream and the first data packet is not acknowledged within a second threshold time after sending the first data packet, and the second network card sends the first data packet to the first device again. The second threshold time may be set empirically or flexibly adjusted according to the application scenario.
In the embodiment of the present application, when the second network card sends the data packet, it is determined whether the data packet is the tail packet of the first data stream. The tail packet is the last packet of a data stream and a successful reception of the tail packet indicates to the first device that the entire first data stream has been received in its entirety. After the tail packet is sent, the second network card enters a waiting state to wait for the first device to send the acknowledgement information of the tail packet. The waiting time length is determined by a second threshold time, and the second threshold time is a preset time period and is used for judging whether the first device successfully receives the tail packet.
If the second network card does not receive the acknowledgement information from the first device within the second threshold time, it indicates that the tail packet may not be successfully received. Therefore, the second device takes remedial measures, and in order to ensure the integrity of the first data stream, the second network card sends the tail packet to the first device again, so that the first device can completely receive the whole data stream, and the incompleteness of the first data stream caused by the loss of the tail packet is avoided.
Step 303, the first network card of the first device receives the first data packet sent by the second device.
The first network card of the first device receives the data packets sent by the second device one by one, and the sequence of the data packets received by the first network card is consistent with the sequence of the data packets sent by the second device, so that the first device does not need to reorder the data packets after receiving the data packets, and the resource expenditure generated by ordering the data packets is saved.
In step 304, the first network card of the first device updates transmission information of the first data stream recorded on the first network card based on the first data packet, where the transmission information includes a packet sequence number of the first tail packet and a source end storage location of the first tail packet, the first head packet is a first data packet in a first data packet interval in which the received packet sequence numbers are continuous, and the first tail packet is a last data packet in the first data packet interval, and the transmission information is used to implement packet loss retransmission of the first data stream.
In the embodiment of the application, the first network card of the first device records the transmission information of the first data stream. The transmission information includes information about a first data stream received by a first network card of the first device. For the first packet section, the packet sequence number of the first packet in the first packet section is discontinuous with the packet sequence number of the preceding packet section of the first packet section, and the packet sequence number of the last packet in the first packet section is discontinuous with the packet sequence number of the next packet section of the first packet section.
For example, the packet numbers of the data packets in the first data stream are 1, 2, 3, 4, and 5, and the like, and the step sizes are 1, and the consecutive packet numbers are exemplified by the packet number 1 of the first received data packet, and if the packet numbers received subsequently are consecutive, for example, the packet numbers 1, 2, 3, and 4. The packet number of the next packet received after the packet number of the received packet is 4 is 6, and the packet number of the packet with the packet number of 6 is discontinuous with the packet number of the previous packet, so that the packets with the packet numbers of 1, 2, 3 and 4 can be considered as the first packet interval. Or for the case of consecutive packet numbers 4, 5 and 6, if the packet number of the last packet of the packet number 4 is discontinuous with 4 and the packet number of the next packet of the packet number 6 is discontinuous with 6, determining the packets of packet numbers 4, 5 and 6 as the first packet section.
For the first packet section, the transmission information recorded by the first network card may include information of all packets in the first packet section, for example, the transmission information includes packet numbers 1, 2, 3, 4,5, and the like of the packets, but the transmission information occupies more storage space of the first network card as the number of received packets increases. Therefore, the embodiment of the application takes a mode of recording the packet sequence number of the first tail packet and the packet sequence number of the first tail packet as a recording mode of transmitting information. The first header packet is a first packet in a first packet section in which the received packet sequence numbers are consecutive, and the first trailer packet is a first packet in a first packet section in which the received packet sequence numbers are consecutive. The packet sequence number of the first header packet and the packet sequence number of the first trailer packet may be recorded to determine a first packet interval in which the packet sequence numbers are consecutive, for example, the packet sequence number of the first header packet is 5, the packet sequence number of the first trailer packet is 9, and then the packets of packet sequence numbers 5 to 9 are indicated to be consecutive and no packet is lost. The method for recording the packet sequence numbers of the first header packet and the first trailer packet can save resources and is matched with the condition that the storage space of the first network card is smaller.
In the embodiment of the application, the first head packet and the first tail packet of the first data packet can also be used as the basis for whether the data packet is lost or not. The updating of the transmission information may include the first network card checking a packet sequence number of a first data packet when the first device receives a new data packet, such as the first data packet. If the packet sequence number of the first data packet is continuous, that is, adjacent to the packet sequence number of the first tail packet recorded currently, the first network card updates the packet sequence number and the source storage position of the first tail packet into the packet sequence number and the source storage position of the first data packet, which indicates that the data stream is continuously and continuously transmitted.
For example, the first packet section currently recorded is a packet with packet numbers 1 to 6, and if the packet number of the first packet is 7, it is determined that the first packet belongs to the first packet section. Because the embodiment of the application records the source storage position of the first tail packet, under the condition of determining that the data packet is lost, for example, the packet sequence number of the recorded transmission information first tail packet is 7, the packet sequence number of the first data packet is 9 to indicate that the data packet with the packet sequence number of 8 is lost, and the source storage position of the lost data packet can be determined based on the recorded source storage position of the first tail packet and the source storage position of the first data packet. For example, a source storage location between a source storage location of a first tail packet and a source storage location of a first data packet is determined to be a source storage location of a lost data packet. Alternatively, the source storage positions of a plurality of received data packets can be recorded, and only the source storage position of the first tail packet is recorded, so that the occupation of resources can be saved, and the method is matched with the condition that the storage space of the first network card is smaller.
In an exemplary embodiment of the present application, in determining whether to drop a packet and determining a source storage location of a dropped data packet, a packet sequence number of a first header packet is not used. In this case, the transmission information includes only the packet sequence number of the first tail packet and the source storage location of the first tail packet, that is, the transmission information no longer includes the packet sequence number of the first head packet.
The embodiment of the application provides different updating modes of the transmission information based on whether the packet sequence number of the received first data packet and the packet sequence number of the first tail packet are continuous.
In a first aspect, for a case where a packet sequence number of a received first data packet and a packet sequence number of a first tail packet are consecutive, a process of updating, by the first network card, transmission information of a first data stream recorded on the first network card based on the first data packet includes, in a case where the packet sequence number of the first data packet is consecutive to the packet sequence number of the first tail packet, updating, by the first network card, the packet sequence number of the first tail packet and a source storage location in the transmission information are the packet sequence number of the first data packet and the source storage location.
The received packet sequence number of the first data packet is continuous with the packet sequence number of the first tail packet, which indicates that no data packet is lost between the first data packet and the first tail packet. The packet sequence number and the source end storage position of the first tail packet in the first network card updating transmission information are the packet sequence number and the source end storage position of the first data packet. For example, the first packet interval currently recorded is a packet with packet numbers 1 to 6, and if the packet number of the first packet is 7, it is determined that the first packet belongs to the first packet interval, that is, the first packet interval is continuously updated with the received packet without losing the packet. Thereby ensuring that the first network card can track the latest state of the data stream in real time. The updating of the packet sequence number of the first tail packet and the source storage location can determine the information of the lost data packet based on the latest information of the first tail packet and the received information of the first data packet in the case of the data packet loss.
In a second mode, for the case that the packet sequence number of the received first data packet and the packet sequence number of the first tail packet are discontinuous, the process of updating, by the first network card, the transmission information of the first data stream recorded on the first network card based on the first data packet includes that, in the case that the packet sequence number of the first data packet and the packet sequence number of the first tail packet are discontinuous, the packet sequence number of the first tail packet and the source storage location in the transmission information are the packet sequence number of the first data packet and the source storage location.
The packet sequence number of the first data packet and the packet sequence number of the first tail packet are discontinuous to indicate packet loss between the first data packet and the first tail packet. And under the condition that the data packet is lost, the first network card carries out packet loss retransmission, so that the lost data packet is obtained again, and the integrity of the received data packet is ensured. In the packet loss retransmission process, the sending end (i.e. the second device) of the data needs to retransmit the lost data packet based on the information of the lost data packet, and the information of the lost data packet is sent through the first network card. After the first network card sends the information of the lost data packet, the transmission information recorded on the first network card can be updated into the information of the latest data packet, so that retransmission operation can be performed again when the data packet is lost again later.
The first network card updates the packet sequence number and the source storage position of the received first data packet into the packet sequence number and the source storage position of the first tail packet in the current transmission information. Because a discontinuity occurs in the data stream, that is, the first data packet interval has been determined not to change with receiving a new data packet, the first network card may reset the recorded packet sequence number of the first packet to the packet sequence number of the first data packet, thereby reestablishing the second data packet interval. In order to provide information of lost data packets for the case of packet loss again. It can be understood that the first network card is provided with a first storage position and a second storage position, the first storage position is used for storing the packet sequence number of the first packet of the latest data packet interval, and the second storage position is used for storing the packet sequence number of the last packet of the latest data packet interval. The storage space of the first network card can be saved by circularly updating the information of the recorded data packet interval by using the two storage positions. For example, in the embodiment of the present application, the packet sequence number of the first packet may not be recorded, that is, the data packet interval is not recorded, and the packet loss retransmission is performed through a part of the data packet interval, that is, the tail packet of the data packet interval. It can be understood that the first network card is provided with a first storage location, where the first storage location is used to store the packet sequence number of the tail packet of the latest packet interval.
For the first storage location and the second storage location to lose the packet sequence number of the first tail packet immediately after the transmission of the information update, in order to preserve the packet sequence number of the first tail packet for a short time, additional storage space may be added for recording the information of the second data packet section. The embodiment of the present application does not limit the use of reserving the first tail packet, for example, the packet loss retransmission request may be sent again in the case of failure in sending the packet loss retransmission request, where the content of the packet loss retransmission request may be described in step 304, and will not be described herein.
In a third mode, for the case that the packet sequence number of the received first data packet is discontinuous with the packet sequence number of the first tail packet, the first network card adds and records the packet sequence number of the second tail packet and the source end storage position of the second tail packet in the transmission information, wherein the second tail packet is the last data packet in the second data packet section, and the packet sequence number of the second tail packet and the source end storage position are the packet sequence number of the first data packet and the source end storage position.
The packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet recorded currently, which indicates that the data packet corresponding to the packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the first data packet is lost. Illustratively, adding additional storage space may be understood as adding a new record entry to the transmitted information. The new record entry contains the packet sequence number of the second leading packet, the packet sequence number of the second trailing packet. For example, the first packet interval is a packet with packet numbers 1 to 6, and in the case where the packet number of the first packet is 8, that is, the first packet does not belong to the first packet interval and belongs to the second packet interval, the second packet interval is updated based on the acquired first packet and a packet continuous with the packet number of the first packet.
The second header packet is the first packet in the second packet interval in which the received packet sequence numbers are consecutive. The first packet constitutes the start of a new consecutive packet interval, since the first packet is not consecutive to the preceding first tail packet. The second tail packet is the last packet in the second packet interval. Since the second packet interval starts from the first packet, the first packet is also the last packet of the second packet interval. The first network card takes the packet sequence number of the first data packet as the packet sequence numbers of the second first packet and the second tail packet of the second data packet interval. For example, the embodiment of the present application may perform packet loss retransmission through a portion of the data packet interval, i.e., the tail packet of the data packet interval, without recording the packet sequence number of the second first packet, i.e., without recording the data packet interval.
It can be understood that the first network card is provided with a second storage position, the second storage position is used for storing the packet sequence number of the last tail packet of the first data packet interval, and for the case that the packet sequence number of the first data packet and the packet sequence number of the first tail packet are discontinuous, the first data packet belongs to the second data packet interval, and the second first packet and the second tail packet of the second data packet interval are both the first data packet. The packet sequence number of the second tail packet recorded in the second storage location may determine the packet sequence number of the lost data packet according to the packet sequence number of the second tail packet recorded in the second storage location and the packet sequence number of the first tail packet recorded in the first storage location.
Alternatively, it may be considered that a first location storage location exists in the first network card, where the first location storage location is used to store a source storage location of the first tail packet. Under the condition that the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, the information stored in the first storage position can be updated to be changed into the source end storage position of the first data packet, or a second position storage position is set for storing the source end storage position of the second tail packet in the second data packet section.
Therefore, the transmission information can be updated in real time through the first mode to the third mode, and the accuracy of the transmission information is ensured. In addition, the storage locations corresponding to the first packet interval and the storage locations corresponding to the second packet interval in the embodiment of the present application are merely illustrative, and other storage locations may be additionally set for the third packet interval generated by the packet loss situation that occurs again after the subsequent second packet interval.
In one possible implementation manner, before updating the transmission information of the first data stream recorded on the first network card based on the first data packet, the first network card further includes sending, by the first network card, a first retransmission request to the second device, where the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, the first retransmission request indicates a packet sequence number of the first lost data packet and a source storage location, the packet sequence number of the first lost data packet is a packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the first data packet, the source storage location of the first lost data packet is a storage location between the source storage location of the first tail packet and the source storage location of the first data packet, and the first retransmission request is used by the second device to retransmit the first lost data packet.
The first network card receives the first data packet and determines that the packet sequence number of the first packet and the packet sequence number of the last data packet of the currently recorded transmission information, namely the first tail packet, discontinuously indicate that packet loss occurs in the data transmission process. In order to recover the lost data packet, the first network card of the first device requests retransmission of the lost data packet. The first network card sends a first retransmission request to the second device. The first retransmission request is used to inform the second device which packets are lost and to request the second device to retransmit the lost packets. The first retransmission request specifies a packet sequence number of the lost data packet and a source storage location, the packet sequence number of the lost data packet being a packet sequence number between a packet sequence number of the first tail packet and a packet sequence number of the first data packet. The source storage location of the lost packet is determined based on the first tail packet and the source storage location of the first packet. The source storage location of the lost data packet is the storage location of the lost data packet at the source, i.e., the second device, for the second device to retrieve and send the lost data packet.
In one possible implementation manner, after the second network card sends the first data packet to the first device, the second network card further comprises a first retransmission request sent by the first device, wherein the first retransmission request indicates a packet sequence number and a source storage position of the first lost data packet, the second network card obtains a load of the first lost data packet in a storage module of the second device based on the source storage position of the first lost data packet, generates the first lost data packet based on the load of the first lost data packet and a packet sequence number of the first lost data packet, and sends the first lost data packet to the first device.
The second network card receives a first retransmission request from the first device. The first retransmission request indicates that the data packet received by the first network card has one or more losses. The first retransmission request can indicate a packet sequence number and a source storage location of the lost data packet. The information included in the first retransmission request may be a packet sequence number and a source storage location of the first tail packet and a packet sequence number and a source storage location of the first data packet, or the information included in the first retransmission request may be a packet sequence number and a source storage location of the lost data packet determined based on the packet sequence number and the source storage location of the first tail packet and the packet sequence number and the source storage location of the first data packet. Wherein the packet sequence number of the first data packet and the packet sequence number of the first tail packet are discontinuous.
The second network card re-acquires the load of the first lost data packet based on the storage position of the load of the first lost data packet in the storage module of the second device, which is indicated by the source storage position of the first lost data packet, generates a data packet based on the load of the first lost data packet, and generates the first lost data packet by setting the source storage position and the packet sequence number of the first lost data packet for the data packet. The packet sequence number of the first lost data packet can enable the first lost data packet to determine that the first lost data packet is a retransmission data packet according to the fact that the packet sequence number of the first lost data packet is smaller than the packet sequence number of the latest received data packet when the first lost data packet arrives at the first network card. Optionally, after determining that the received first lost data packet is a retransmission data packet, the first network card sends the retransmission data packet to the first processor, and the first processor determines a storage position corresponding to the load of the retransmission data packet when writing the load of the retransmission data packet into the storage module of the first device.
In one possible implementation manner, the first device further comprises a first processor, after the first network card sends the first retransmission request to the second device, the first device further comprises a first network card receiving a retransmission data packet, wherein the retransmission data packet comprises at least one data packet in a first lost data packet sent by the second device, and the first network card sends the retransmission data packet to the first processor, and the first network card is used for writing a load of the retransmission data packet into a storage module of the first device.
The first device includes, in addition to the first network card, a first processor for processing and controlling various operations of the device. After the first network card sends a first retransmission request to the second device, the first network card receives a retransmission data packet sent by the first device. The retransmission packet is a packet retransmitted by the second network card of the second device according to the information provided in the first retransmission request. The retransmission data packet at least comprises one or more of the data packets lost by the first device, namely, the lost data packet indicated by the first retransmission request is sent by the second network card, but may be lost in the retransmission process.
The second network card sends a lost data packet indicated by the first retransmission request according to the first retransmission request, but in the process of sending all the data packets indicated by the first retransmission request, the data packets may be lost due to network fluctuation and other reasons, so that the content of the retransmitted data packet received by the first network card is different from that of the data packet sent by the second network card. For example, the lost data packets indicated by the first retransmission request are data packets with packet numbers 4, 5 and 6, and the second network card retransmits the data packets with packet numbers 4, 5 and 6, but the retransmitted data packet received by the first network card may be the data packet with packet number 4, i.e. the data packets with packet numbers 5 and 6 are lost again in the retransmission process.
And after receiving the retransmission data packet, the first processor writes the load of the retransmission data packet into a storage module of the first device according to the packet sequence number of the retransmission data packet. The storage module of the first device is a storage space used by the first device to store data, and may be a local memory of the first device or an external storage device connected with the first device. And the load of the retransmission data packet is written into the storage module of the first device to recover the lost data, so that the integrity of the data received by the first device is ensured.
The first device can effectively cope with the packet loss problem based on the first processor, and the reliability and stability of data transmission are improved. The first processor is a hardware component in the first device for executing instructions and processing data. The processing capacity of the first processor is higher than that of the first network card, so that the load of the retransmission data packet can be written in the corresponding position.
And under the condition that the first network card further comprises a first processor, the first network card sends packet loss information of the first data stream to the first processor under the condition that the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, and the packet loss information is used for realizing packet loss retransmission of the first data stream by the first processor and comprises the packet sequence number of the first tail packet, a source end storage position of the first tail packet, the packet sequence number of the first data packet and a source end storage position of the first data packet.
When the first network card receives the first data packet and finds that the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet recorded currently. In order to inform the processor to enable the first processor to determine the current packet loss condition, the first network card sends packet loss information of the first data stream to the first processor. The packet loss information comprises a packet sequence number of the first tail packet, a source end storage position of the first tail packet, a packet sequence number of the first data packet and a source end storage position of the first data packet. Optionally, the packet loss information may further include a packet sequence number of the first packet, where the packet sequence number of the first packet and the packet sequence number of the first tail packet may be used to determine a first packet interval, thereby determining a number of data packets that are continuously and successfully transmitted, and evaluating quality of data packet transmission.
The first processor stores packet loss information, and the packet loss information can be updated when a retransmission data packet is received. In one possible implementation manner, after the first network card sends the retransmission data packet to the first processor, the method further comprises the step that the first network card sends a second retransmission request to the second device, the second retransmission request is generated by the first processor when packet loss information of the first data stream stored by the first processor is updated according to a packet sequence number of the retransmission data packet, the updated packet loss information indicates that the first data stream has a second lost data packet, the second retransmission request indicates a packet sequence number of the second lost data packet and a source end storage position of the second lost data packet, and the second retransmission request is used for the second device to retransmit the second lost data packet.
The first processor writes the load of the retransmission data packet into the storage module of the first device, and the retransmission process is not finished. The first processor stores packet loss information related to the first data stream, and updates the packet loss information according to the packet sequence number of the newly received retransmission data packet, so as to ensure the accuracy of the packet loss information and reflect the state of the current data stream. The updated packet loss information may indicate that in case a part of the lost data packets has been retransmitted, there are still other lost data packets in the data stream, i.e. the second lost data packet.
The first network card sends a second retransmission request to the second device, where the second retransmission request is used to inform the second device which data packets are not successfully transmitted, and requests to retransmit the lost data packet. The information included in the second retransmission request may refer to the information included in the first retransmission request, which is not described herein. Through the continuous retransmission mechanism, the first network card can continuously recover the lost data packet until the whole data stream is complete and error-free. Thereby ensuring reliable and stable data transmission.
In one possible implementation mode, the method further comprises the steps that the first network card sends a third retransmission request to the second device, the third retransmission request is generated by the first processor when packet loss information stored by the first processor exceeds a first threshold time and the stored packet loss information indicates that a third lost data packet exists in the first data stream, the third retransmission request indicates a packet sequence number and a source end storage position of the third lost data packet, and the third retransmission request is used for the second device to retransmit the third lost data packet.
And setting a parameter of the first threshold time, and if the packet loss information maintained by the first processor is not updated within the first threshold time, checking the current packet loss information by the first processor. If the current packet loss information indicates that there is still a lost packet in the first data stream, i.e. a third lost packet, the first processor triggers an additional retransmission request, i.e. a third retransmission request. The information included in the third retransmission request may refer to the information included in the first retransmission request, which is not described herein.
Retransmission mechanisms based on a first time threshold are used to handle long-term unrepaired packet loss conditions due to various reasons, such as network congestion, equipment failure, etc. For example, it may be that the retransmission request sent by the first network card is lost during the process of sending to the second device, or that the data packet retransmitted by the second network card is lost during the process of sending to the first network card.
In one possible implementation manner, the first network card performs the packet retransmission operation in the case that there is a packet loss, that is, the packet sequence number of the first packet is discontinuous with the packet sequence number of the first tail packet. Alternatively, the retransmission of the data packet may occur before or after updating the transmission information.
In the case that the retransmission process of the data packet occurs after updating the transmission information, the first network card updates the transmission information of the first data stream recorded on the first network card based on the first data packet, and further includes that, in the case that the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, the transmission information of the first data stream includes the packet sequence number of the first tail packet, a source end storage location, and the packet sequence number of the second head packet, and the source end storage location, where the second head packet is the first data packet, the first network card sends a fourth retransmission request to the second device, the fourth retransmission request indicates the packet sequence number of the lost data packet and the source end storage location, the packet sequence number of the lost data packet is the packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the second head packet, the source end storage location of the lost data packet is the storage location between the source end storage location of the first tail packet and the source end storage location of the second head packet, and the fourth retransmission request is used for retransmitting the lost data packet by the second device.
In one possible implementation manner, for the third manner, after the first network card sends the first retransmission request, the information stored in the storage location corresponding to the first data packet interval may be directly released, so as to implement recycling of the storage space. Or under the condition that the first processor of the first device receives the packet loss information of the first data stream sent by the first network card, the first network card receives the release message sent by the first processor, and the first network card releases the storage space of the packet sequence number of the first tail packet based on the release message. The released storage space is used for recording a packet sequence number of a third tail packet, and the third tail packet is a last data packet in a third data packet interval with continuous packet sequence numbers after the received second data packet interval.
When the first retransmission request is sent, the storage space of the first network card is managed in order to improve the utilization rate of the storage space of the first network card. Optionally, the storage space for storing the packet sequence numbers of the first header packet and the first trailer packet of the first data packet interval is released. And then, the first processor of the first device receives packet loss information of the first data stream from the first network card. And under the condition that the packet loss information of the first data stream is received, the first processor generates a release message according to the received packet loss information of the first data stream. The release message indicates a storage space for storing packet sequence numbers of the first head packet and the first tail packet before the first network card is released.
And after receiving the release message, the first network card releases the storage space corresponding to the first data packet interval. The released storage space is reused for recording the information of the new data packet interval, namely the packet sequence numbers of the third first packet and the third tail packet. As data is continuously received, new header and trailer information is continually updated to reflect the latest state of the data stream. And releasing the storage space for storing the packet sequence number of the first tail packet of the first data packet interval and the storage space for storing the third tail packet of the third data packet interval under the condition that the storage space of the first network card does not record the packet sequence number of the first packet of the data packet interval, so as to realize the cyclic utilization of the storage space of the first network card.
In step 305, the first network card of the first device writes the load of the first data packet to the storage module of the first device.
The process of the first network card analyzing the first data packet to obtain the load of the first data packet, writing the load of the first data packet into the storage module of the first device may include that the first network card distributes a corresponding receiving end WQE buffer for the load of the first data packet, where the receiving end WQE buffer indicates a storage location where the load of the first data packet is stored in the storage module of the first device.
An exemplary embodiment of the present application provides a system architecture schematic for data transmission, referring to fig. 4, a network card is connected to a host in a PCIe manner, and for a data packet received by a data center processor (data processing unit, DPU) of the network card, the network card determines whether the received data packet is a normal data packet or a retransmitted data packet, where the normal data packet is a non-retransmitted data packet received by a first device. If the received data packet is a normal data packet, recording the packet sequence number of the data packet through an entry processing module of the first device. Illustratively, one data stream corresponds to one QP, one QP corresponds to one queue pair context (queue pair context, QPC), and the QP list includes QPs (QP 1-QPN, N is a positive integer as shown in fig. 4) respectively corresponding to the plurality of data streams received by the network card. For each data flow, a corresponding WQE buffer is allocated, and the allocated WQE buffer indicates the storage position of the data packet in the storage module of the host.
For the data packet received by the network card, determining the Mean Time To (MTT) of the data packet, and writing the load of the data packet into a designated position in the data memory (i.e. the memory module of the first device) of the host through DMA. One QPC corresponds to transmission information of one data stream, and as shown in fig. 4, one QPC includes t1_a, t1_b, t2_a, t2_b, R1, and R2. For example, t1_a and t1_b correspond to the packet sequence number of the first header packet and the packet sequence number of the first trailer packet, t2_a and t2_b correspond to the packet sequence number of the second header packet and the packet sequence number of the second trailer packet, respectively, and R1 and R2 correspond to the source storage location. Taking QPC corresponding to QP1 in fig. 4 as an example, t1_a has a value of 0×8011 a, T1_b has a value of 0×800f, T2_a has a value of 0×8011 a, T2_b has a value of 0×8020, r1 has a value of 0×0100, and r2 has a value of 0×cccc.
Optionally, the process of sending the data packet by the network card to the host may establish a data plane (DATA PLANE, DP) send queue for the network card, and the host establishes a DP receive queue, and transmits the data packet through the DP send queue and the DP receive queue. The data packet generator is used for generating acknowledgement characters (acknowledge character, ACK) or negative acknowledgement characters (negative acknowledge character, NACK) for the data packets received by the entry processing module, and for the data packets received by the network card, the network card sends the ACK to the sending end so that the sending end confirms that the data packets are successfully sent. And transmitting NACK for the data packet which is not received, namely generating a retransmission request and transmitting the retransmission request to a transmitting end.
If the received data packet is a retransmission data packet, the retransmission data packet is sent to a processor of the host through the network card, and the load of the retransmission data packet is directly written into a data memory of the host through the processor of the host, namely, the data is directly stored into the memory of the host.
In fig. 4, the data is passed through a loss recorder for recording the packet number of the lost data packet before being stored in the data memory, for example, the packet number of the data packet received by the DP reception queue is not continuous, and the loss recorder may record the packet number of the lost data packet. In addition, if a retransmission packet is received, the loss recorder may update the packet number of the recorded lost packet according to the packet number of the received retransmission packet.
For convenience of understanding, the embodiment of the present application provides a data transmission scenario, referring to fig. 5, fig. 5 includes a sender application (that is, an application program that invokes a first data stream), a sender driver and an intermediate layer, a sender network card (that is, a second network card), a receiver application (that is, an application program that invokes a first data stream), a receiver driver and an intermediate layer, and a receiver network card (that is, a first network card).
As shown in fig. 5, the sending end application sends a sending command, the receiving end sends a receiving command, the sending command is used for the sending end to execute an operation of sending a data packet, the receiving command is used for the receiving end to execute an operation of receiving the data packet, after the sending end and the receiving end apply QP, the sending end application issues WQE for sending the data packet, and the receiving end application issues WQE for receiving the data packet. The sending end obtains the data to be sent from the second memory to the second network card in a DMA mode. The second network card splits the data to be sent into data packets of proper size and assembles the data packets into custom RDMA data packets, wherein the data packets contain WQE numbers and offset fields (i.e. source storage locations) in the WQEs. The second network card sends the data packet to the first network card according to the sequence of the packet serial numbers.
The first network card sequentially receives and analyzes the data packets, and writes the loads of the data packets into the appointed position of the first memory in a DMA mode. The first network card maintains two tuples T1 and T2 in the first network card record QPC, records a continuous range of packet sequence numbers, and two registers R1 and R2 (not shown in fig. 5) record WQE numbers and WQE internal offsets. The binary group T1 is used for recording a packet sequence number of a first packet and a packet sequence number of a first tail packet in a first data packet section, and the binary group T2 is used for recording a packet sequence number of a second first packet and a packet sequence number of a second tail packet in a second data packet section. Taking the example of receiving a packet with a packet number of 1, the two-tuple T1 is stored as [1,1], where the first 1 is the packet number of the first header packet and the second 1 is the packet number of the first trailer packet, and the two-tuple T2 is not stored at this time, and the content is marked as [ null ].
Based on the packet sequence number discontinuity of the data packet, for example, the data packet with the packet sequence number of 3 is missing, a first retransmission request, namely, a negative acknowledgement character NACK is sent, and the NACK is used for determining the position of the load of the lost data packet stored in the second device by the sending network card (namely, the second network card). The second network card generates a lost data packet for retransmission based on the load of the lost data packet and the packet sequence number of the lost data packet, and transmits the lost data packet to the first network card. The receiving network card (i.e. the first network card) identifies the retransmitted data packet in such a way that the packet sequence number of the retransmitted data packet is smaller than the packet sequence number of the data packet being received, or based on a special field of the retransmitted data packet. And the receiving end driver and the middle layer write the load of the retransmission data packet into the corresponding memory area, namely data homing. Optionally, after the receiving end driver and the intermediate layer write the load of the retransmitted data packet into the corresponding memory area, that is, the data homing, the binary set T2 recorded in the receiving end network card may be released, and the re-recording may be started from the packet sequence number of the newly received first data stream.
In addition, the first network card sends packet loss information to the first processor (i.e. the receiving end driver and the middle layer) for the first processor to maintain the packet loss information. And the first processor sends release information to the first network card under the condition of receiving the packet loss information, and the release information is used for releasing the content stored in the TI. After the receiving end receives the tail packet, the receiving end submits a completion queue entry (completion queue entry, CQE) to the first processor, waits for the first processor to carry out data integrity check, sends a transmission completion acknowledgement character after the check is completed, and after the transmitting end receives the transmission completion acknowledgement character, submits the CQE to the second processor (namely a transmitting end driver and an intermediate layer) to mark the completion of transmission. In addition, the first processor sends a completion queue poll (completion queue poll, CQP) to the receiving side application and the second processor (i.e., the sending side driver and middle layer) sends a CQP to the sending side application indicating that the first data stream transmission is complete.
In summary, according to the RDMA technology that the receiving end directly writes data into the first memory based on the first network card, the source storage position is carried by the data packet, so that the sending end of the device can determine the position of the lost data packet based on the source storage position and retransmit the lost data packet. The network card records the transmission information of the data stream in the form of the packet sequence number, so that the network card can determine the packet loss condition through the transmission information and send retransmission request information. In addition, the storage position of the transmission information for storage in the network card is smaller, for example, only the packet sequence number for storing the first tail packet and the source end storage position of the first tail packet are set, so that the storage space of the network card is saved, and the network card with smaller storage space is matched.
The above describes a data transmission method provided by the embodiment of the present application, and the embodiment of the present application further provides a data transmission device corresponding to the method. The apparatus is used for executing the data transmission method executed by the first network card of the first device in the above description through the respective modules shown in fig. 6. As shown in fig. 6, the data transmission device provided in the embodiment of the present application includes the following modules.
The first receiving module 601 is configured to receive a first data packet sent by a second device, where the first data packet carries a packet sequence number and a source storage location, and the source storage location of the first data packet is a storage location of a load of the first data packet on the second device, where the first data packet belongs to a first data stream;
The recording module 602 is configured to update, based on the first data packet, transmission information of the first data stream recorded on the first network card, where the transmission information includes a packet sequence number of a first tail packet and a source end storage location of the first tail packet, where the first tail packet is a last data packet in the first data packet interval, and the transmission information is used to implement packet loss retransmission of the first data stream;
the writing module 603 is configured to write the load of the first data packet to the storage module of the first device.
In one possible implementation, the device further includes a first sending module, configured to send a first retransmission request to the second device when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, where the first retransmission request indicates the packet sequence number of the first lost data packet and the source storage location, the packet sequence number of the first lost data packet is the packet sequence number between the packet sequence number of the first tail packet and the packet sequence number of the first data packet, the source storage location of the first lost data packet is a storage location between the source storage location of the first tail packet and the source storage location of the first data packet, and the first retransmission request is used for the second device to retransmit the first lost data packet.
In a possible implementation manner, the device further comprises a second sending module, configured to send packet loss information of the first data stream to the first processor when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, where the packet loss information is used for the first processor to implement packet loss retransmission of the first data stream, and the packet loss information includes the packet sequence number of the first tail packet, the source storage location of the first tail packet, the packet sequence number of the first data packet, and the source storage location of the first data packet.
In one possible implementation, the receiving module is further configured to receive a retransmission packet, where the retransmission packet includes at least one packet of the first missing data packet sent by the second device, and the second sending module is further configured to send the retransmission packet to the first processor, where the first processor writes a load of the retransmission packet to the storage module of the first device.
In one possible implementation manner, the first sending module is further configured to send a second retransmission request to the second device, where the second retransmission request is generated by the first processor when the packet loss information of the first data stream stored by the first processor is updated according to the packet sequence number of the retransmission data packet, and the updated packet loss information indicates that the first data stream has the second lost data packet, and the second retransmission request indicates the packet sequence number of the second lost data packet and the source storage location of the second lost data packet, and the second retransmission request is used for the second device to retransmit the second lost data packet.
In one possible implementation manner, the first sending module is further configured to send a third retransmission request to the second device, where the third retransmission request is generated by the first processor when the packet loss information stored by the first processor exceeds a first threshold time and the stored packet loss information indicates that the first data stream has a third lost packet, and the third retransmission request indicates a packet sequence number and a source storage location of the third lost packet, and the third retransmission request is used for the second device to retransmit the third lost packet.
In a possible implementation manner, the recording module 602 is configured to update the packet sequence number and the source storage location of the first tail packet in the transmission information to the packet sequence number and the source storage location of the first data packet when the packet sequence number of the first data packet is consecutive to the packet sequence number of the first tail packet.
In a possible implementation manner, the recording module 602 is configured to update the packet sequence number and the source storage location of the first tail packet in the transmission information to the packet sequence number and the source storage location of the first data packet when the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet.
In a possible implementation manner, the recording module 602 is configured to, in a case where the packet sequence number of the first data packet is discontinuous with the packet sequence number of the first tail packet, increase and record, in the transmission information, the packet sequence number of the second tail packet and the source storage location of the second tail packet, where the second tail packet is the last data packet in the second data packet section, and the packet sequence number of the second tail packet and the source storage location are the packet sequence number of the first data packet and the source storage location.
In one possible implementation manner, the device further comprises a second receiving module, a releasing module and a releasing module, wherein the second receiving module is used for receiving a releasing message sent by the first processor when the first processor of the first device receives packet loss information of a first data stream sent by the first network card, the releasing module is used for releasing a storage space of a packet sequence number of a first tail packet based on the releasing message, the released storage space is used for recording a packet sequence number of a third tail packet, and the third tail packet is the last data packet in a third data packet interval with continuous packet sequence numbers after the received second data packet interval.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol.
It should be appreciated that the device shown in fig. 6 described above provides the same benefits as the method shown in fig. 3 when performing its functions. The apparatus shown in fig. 6 is only exemplified by the above-mentioned division of each functional module when implementing the functions, and in practical application, the above-mentioned functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the device is divided into different functional modules to implement all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
The embodiment of the application also provides another data transmission device. The apparatus is used to perform the data transmission method performed by the second network card of the second device in the above description through the respective modules shown in fig. 7. As shown in fig. 7, the data transmission device provided in the embodiment of the present application includes the following modules.
The generating module 701 is configured to obtain a load of a first data stream in the storage module of the second device, generate a first data packet based on the load, where the first data packet carries a packet sequence number and a source storage location, and the source storage location of the first data packet is a storage location of the load of the first data packet on the second device;
A sending module 702, configured to send a first data packet to a first device.
In a possible implementation manner, the device further comprises a receiving module, a generating module 701 and a sending module 702, wherein the receiving module is used for receiving a first retransmission request sent by a first device, the first retransmission request indicates a packet sequence number and a source storage position of a first lost data packet, the generating module is further used for acquiring a load of the first lost data packet in a storage module of a second device based on the source storage position of the first lost data packet, and generating the first lost data packet based on the load of the first lost data packet and the packet sequence number of the first lost data packet, and the sending module 702 is further used for sending the first lost data packet to the first device.
In a possible implementation manner, the sending module 702 is further configured to send the first data packet to the first device again if the first data packet is a tail packet of the first data stream and the first data packet is not acknowledged within a second threshold time after the first data packet is sent.
In one possible implementation, the first data stream is transmitted based on an RDMA protocol.
It should be appreciated that the device shown in fig. 7 described above provides the same benefits as the method shown in fig. 3 when performing its functions. In the apparatus shown in fig. 7, when implementing the functions thereof, only the above-mentioned division of each functional module is exemplified, and in practical application, the above-mentioned functional allocation may be implemented by different functional modules, i.e. the internal structure of the device is divided into different functional modules, so as to implement all or part of the functions described above. In addition, the apparatus and the method embodiments provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the apparatus and the method embodiments are detailed in the method embodiments and are not repeated herein.
The embodiment of the application provides data transmission equipment, which comprises a memory and a processor, wherein at least one computer instruction is stored in the memory, and the at least one computer instruction is loaded and executed by the processor so as to enable the data transmission equipment to realize the data transmission method shown in fig. 3.
Referring to fig. 8, fig. 8 shows a schematic structural diagram of a network device 1300 provided by the present application. The network device 1300 shown in fig. 8 is used to perform the operations related to the data transmission method shown in fig. 3 described above. The network device 1300 is, for example, a switch or the like, and the network device 1300 may be implemented by a general bus architecture.
As shown in fig. 8, the network device 1300 includes at least one processor 1301, a memory 1303, and at least one communication interface 1304.
Processor 1301 is, for example, a general-purpose central processing unit (central processing unit, CPU), digital signal processor (DIGITAL SIGNAL processor, DSP), network processor (network processer, NP), graphics processor (graphics processing unit, GPU), neural-network processor (neural-network processing units, NPU), data processing unit (data processing unit, DPU), microprocessor, or one or more integrated circuits for implementing aspects of the present application. For example, processor 1301 includes an application-specific integrated circuit (ASIC), a programmable logic device (programmable logic device, PLD) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. PLDs are, for example, complex programmable logic devices (complex programmable logic device, CPLD), field-programmable gate arrays (FPGAs), general-purpose array logic (GENERIC ARRAY logic, GAL), or any combination thereof. Which may implement or perform the various logical blocks, modules, and circuits described in connection with the disclosure of embodiments of the application. A processor may also be a combination of computing functions, including for example, one or more microprocessor combinations, a combination of DSPs and microprocessors, and the like.
Optionally, the network device 1300 also includes a bus. A bus is used to transfer information between the components of the network device 1300. The bus may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one line is shown in fig. 8, but not only one bus or one type of bus.
The Memory 1303 is, for example, but not limited to, a read-only Memory (ROM) or other type of static storage device that can store static information and instructions, a random access Memory (random access Memory, RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-only Memory, EEPROM), a compact disc (compact disc read-only Memory) or other optical disc storage, a compact disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium, or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 1303 is, for example, independent and connected to the processor 1301 through a bus. Memory 1303 may also be integrated with processor 1301.
The communication interface 1304 uses any transceiver-like device for communicating with other devices or communication networks, which may be Ethernet, radio Access network (radio access network, RAN), or wireless local area network (wireless local area networks, WLAN), etc. The communication interface 1304 may include a wired communication interface and may also include a wireless communication interface. Specifically, the communication interface 1304 may be an Ethernet interface, a fast Ethernet (FAST ETHERNET, FE) interface, a gigabit Ethernet (gigabit Ethernet, GE) interface, an asynchronous transfer mode (asynchronous transfer mode, ATM) interface, a wireless local area network (wireless local area networks, WLAN) interface, a cellular network communication interface, or a combination thereof. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. In an embodiment of the present application, the communication interface 1304 may be used for the network device 1300 to communicate with other devices.
In a particular implementation, processor 1301 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 8, as an embodiment. Each of these processors may be a single-core (single-core CPU) processor or may be a multi-core (multi-core CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a particular implementation, as one embodiment, network device 1300 may include multiple processors, such as processor 1301 and processor 1305 shown in fig. 8. Each of these processors may be a single-Core Processor (CPU) or a multi-core processor (multi-core CPU). A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In a specific implementation, the network device 1300 may also include output devices and input devices, as one embodiment. An output device communicates with processor 1301 and can display information in a variety of ways. For example, the output device may be a Liquid Crystal Display (LCD) CRYSTAL DISPLAY, a Light Emitting Diode (LED) display device, a Cathode Ray Tube (CRT) display device, a projector (projector), or the like. The input device(s) are in communication with the processor 1301 and may receive user input in a variety of ways. For example, the input device may be a mouse, a keyboard, a touch screen device, a sensing device, or the like.
In some embodiments, the memory 1303 is configured to store program codes 1310 for performing aspects of the present application, and the processor 1301 may execute the program codes 1310 stored in the memory 1303. That is, the network device 1300 may implement the data transmission method provided by the method embodiment through the processor 1301 and the program code 1310 in the memory 1303. One or more software modules may be included in program code 1310. Optionally, processor 1301 itself may store program code or instructions to perform aspects of the present application.
In a specific embodiment, the network device 1300 according to the embodiment of the present application may correspond to the first device in the foregoing method embodiments, where the processor 1301 in the network device 1300 reads the instructions in the memory 1303, so that the network device 1300 shown in fig. 8 can implement all or part of the operations performed by the first device.
Other optional embodiments are not described here again for brevity.
In a specific embodiment, the network device 1300 according to the embodiment of the present application may correspond to the first device in the above-mentioned method embodiments, where the processor 1301 in the network device 1300 reads the instructions in the memory 1303, so that the network device 1300 shown in fig. 8 can implement all or part of the operations performed by the second device.
Other optional embodiments are not described here again for brevity.
The network device 1300 may also correspond to the data transmission apparatus shown in fig. 6 or fig. 7 described above, and each functional module in the data transmission apparatus is implemented in software of the network device 1300. In other words, the functional module included in the data transmission apparatus is generated after the processor 1301 of the network apparatus 1300 reads the program code 1310 stored in the memory 1303.
Wherein the steps of the data transmission method shown in fig. 3 are performed by means of instructions in the form of integrated logic circuits of hardware or software in the processor of the network device 1300. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads information in the memory, and in combination with its hardware, performs the steps of the above method, which will not be described in detail here to avoid repetition.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a network device 1400 according to another exemplary embodiment of the present application, and the network device 1400 shown in fig. 9 is configured to perform all or part of the operations related to the data transmission method shown in fig. 3. The network device 1400 is, for example, a switch, router, etc., and the network device 1400 may be implemented by a general bus architecture.
As shown in fig. 9, the network device 1400 includes a main control board 1410 and an interface board 1430.
The main control board is also called a main processing unit (main processing unit, MPU) or a routing processing card (route processor card), and the main control board 1410 is used for controlling and managing various components in the network device 1400, including routing computation, device management, device maintenance, and protocol processing functions. The main control board 1410 includes a central processor 1411 and a memory 1412.
Interface board 1430 is also referred to as a line interface unit (line processing unit, LPU), line card, or service board. Interface board 1430 is used to provide various service interfaces and to enable forwarding of data packets. The service interfaces include, but are not limited to, ethernet interfaces, such as flexible ethernet service interfaces (flexible ETHERNET CLIENTS, flexE Clients), POS (Packet over SONET/SDH) interfaces, and the like. Interface board 1430 includes a central processor 1431, a network processor 1432, forwarding table entry memory 1434, and a physical interface card (PHYSICAL INTERFACE CARD, PIC) 1433.
The central processor 1431 on the interface board 1430 is configured to control and manage the interface board 1430 and communicate with the central processor 1411 on the main control board 1410.
The network processor 1432 is used to implement data transmission. The network processor 1432 may be in the form of a forwarding chip. The forwarding chip may be a network processor (network processor, NP). In some embodiments, the forwarding chip may be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (field programmable GATE ARRAY, FPGA). Specifically, the network processor 1432 is configured to forward the received packet based on the forwarding table stored in the forwarding table entry memory 1434, if the destination address of the packet is the address of the network device 1400, send the packet to the CPU (e.g. the central processing unit 1431) for processing, and if the destination address of the packet is not the address of the network device 1400, find the next hop and the egress interface corresponding to the destination address from the forwarding table according to the destination address, and forward the packet to the egress interface corresponding to the destination address. The processing of the uplink message may include processing of a message input interface, forwarding table lookup, and the processing of the downlink message may include forwarding table lookup, etc. In some embodiments, the central processor may also perform the function of a forwarding chip, such as implementing software forwarding based on a general purpose CPU, so that no forwarding chip is needed in the interface board.
The physical interface card 1433 is used to implement the docking function of the physical layer, from which the original traffic enters the interface board 1430, and from which processed messages are sent out from the physical interface card 1433. The physical interface card 1433, also referred to as a daughter card, may be mounted on the interface board 1430 and is responsible for converting the photoelectric signals into messages and forwarding the messages to the network processor 1432 for processing after the messages are checked for validity. In some embodiments, the central processor 1431 may also perform the functions of the network processor 1432, such as implementing software forwarding based on a general purpose CPU, so that the network processor 1432 is not needed in the physical interface card 1433.
Optionally, network device 1400 includes a plurality of interface boards, e.g., network device 1400 further includes an interface board 1440, interface board 1440 including a central processor 1441, a network processor 1442, a forwarding table entry memory 1444, and a physical interface card 1443. The function and implementation of the components in interface board 1440 are the same as or similar to interface board 1430 and will not be described in detail here.
Optionally, the network device 1400 also includes a switching network board 1420. Switch board 1420 may also be referred to as a switch board unit (switch fabric unit, SFU). In the case of a network device 1400 having multiple interface boards, the switch board 1420 is used to complete data exchange between the interface boards. For example, interface board 1430 and interface board 1440 may communicate via switch board 1420.
The main control board 1410 is coupled to an interface board. For example. The main control board 1410, the interface board 1430 and the interface board 1440 are connected to the system back board through the system bus to realize intercommunication between the switch board 1420 and the system back board. In one possible implementation, an inter-process communication protocol (inter-process communication, IPC) channel is established between the main control board 1410 and the interface boards 1430 and 1440, and communication is performed between the main control board 1410 and the interface boards 1430 and 1440 through the IPC channel.
Logically, network device 1400 includes a control plane that includes a main control board 1410 and a central processor 1411, and a forwarding plane that includes various components that perform forwarding, such as a forwarding table entry memory 1434, a physical interface card 1433, and a network processor 1432. The control plane performs the functions of a router, generating a forwarding table, processing signaling and protocol messages, configuring and maintaining the state of the network device, and the like, and issues the generated forwarding table to the forwarding plane, and at the forwarding plane, the network processor 1432 forwards the message received by the physical interface card 1433 by looking up a table based on the forwarding table issued by the control plane. The forwarding table issued by the control plane may be stored in forwarding table entry memory 1434. In some embodiments, the control plane and the forwarding plane may be completely separate and not on the same network device.
It should be noted that the main control board may have one or more blocks, and the main control board and the standby main control board may be included when there are multiple blocks. The interface boards may have one or more, the more data processing capabilities the network device is, the more interface boards are provided. The physical interface card on the interface board may also have one or more pieces. The switching network board may not be provided, or may be provided with one or more blocks, and load sharing redundancy backup can be jointly realized when the switching network board is provided with the plurality of blocks. Under the centralized forwarding architecture, the network device may not need to exchange network boards, and the interface board bears the processing function of the service data of the whole system. Under the distributed forwarding architecture, the network device may have at least one switching fabric, through which data exchange between multiple interface boards is implemented, providing high-capacity data exchange and processing capabilities. Therefore, the data access and processing power of the network device of the distributed architecture is greater than that of the network device of the centralized architecture. Alternatively, the network device may have a configuration in which only one board card is provided, that is, there is no switching network board, the functions of the interface board and the main control board are integrated on the one board card, and the central processor on the interface board and the central processor on the main control board may be combined into one central processor on the one board card, so as to perform the functions after stacking the two, where the network device has low data exchange and processing capabilities (for example, network devices such as a low-end switch or a router). The specific architecture employed is not limited in any way herein, depending on the specific networking deployment scenario.
In a specific embodiment, the network device 1400 corresponds to the data transmission apparatus shown in fig. 6 or fig. 7 described above.
It should be appreciated that the processor may be a CPU, but may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor or the like. It is noted that the processor may be a processor supporting an advanced reduced instruction set machine (ADVANCED RISC MACHINES, ARM) architecture.
Further, in an alternative embodiment, the memory may include read only memory and random access memory, and provide instructions and data to the processor. The memory may also include non-volatile random access memory. For example, the memory may also store information of the device type.
The memory may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an erasable programmable ROM (erasable PROM), an electrically erasable programmable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available. For example, static random access memory (STATIC RAM, SRAM), dynamic random access memory (dynamic random access memory, DRAM), synchronous Dynamic Random Access Memory (SDRAM), double data rate synchronous dynamic random access memory (doubledata RATE SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (ENHANCED SDRAM, ESDRAM), synchronous link dynamic random access memory (SYNCHLINK DRAM, SLDRAM), and direct memory bus random access memory (direct rambus RAM, DR RAM).
The embodiment of the application also provides a data transmission system, which comprises a first device and a second device, wherein the first device comprises a first network card for executing the data transmission method shown in fig. 3, and the second device comprises a second network card for executing the data transmission method shown in fig. 3.
The embodiment of the application also provides a computer readable storage medium, wherein at least one instruction is stored in the storage medium, and the instruction is loaded and executed by a processor, so that the computer realizes the data transmission method shown in fig. 3.
The embodiment of the present application also provides a computer program (product) which, when executed by a computer, can cause a processor or a computer to perform the data transmission method shown in fig. 3.
The embodiment of the application also provides a chip, which comprises a processor and is used for calling and running the instructions stored in the memory from the memory, so that the computer provided with the chip executes the data transmission method shown in fig. 3.
The embodiment of the application also provides another chip, which comprises an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected through an internal connection path, the processor is used for executing codes in the memory, and when the codes are executed, the computer provided with the chip executes the data transmission method shown in fig. 3.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more available media. Usable media may be magnetic media (e.g., floppy disk, hard disk, magnetic tape), optical media (e.g., DVD), or semiconductor media (e.g., solid state disk (solid state STATE DISK)), or the like.
Those of ordinary skill in the art will appreciate that the various method steps and modules described in connection with the embodiments disclosed herein may be implemented as software, hardware, firmware, or any combination thereof, and that the steps and components of the various embodiments have been generally described in terms of functionality in the foregoing description to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Those of ordinary skill in the art may implement the described functionality using different approaches for each particular application, but such implementation is not considered to be beyond the scope of the present application.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the above storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. By way of example, the methods of embodiments of the present application may be described in the context of machine-executable instructions, such as program modules, being included in devices on a real or virtual processor of a target. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. In various embodiments, the functionality of the program modules may be combined or split between described program modules. Machine-executable instructions for program modules may be executed within local or distributed devices. In a distributed device, program modules may be located in both local and remote memory storage media.
Computer program code for carrying out methods of embodiments of the present application may be written in one or more programming languages. These computer program code may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the computer or other programmable data processing apparatus, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the computer, partly on the computer, as a stand-alone software package, partly on the computer and partly on a remote computer or entirely on the remote computer or server.
In the context of embodiments of the present application, computer program code or related data may be carried by any suitable carrier to enable an apparatus, device or processor to perform the various processes and operations described above. Examples of carriers include signals, computer readable media, and the like.
Examples of signals may include electrical, optical, radio, acoustical or other form of propagated signals, such as carrier waves, infrared signals, etc.
A machine-readable medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination thereof. More detailed examples of a machine-readable storage medium include an electrical connection with one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical storage device, a magnetic storage device, or any suitable combination thereof.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described device embodiments are merely illustrative, e.g., the division of the modules is merely a logical function division, and there may be additional divisions of actual implementation, e.g., multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or modules, or may be an electrical, mechanical, or other form of connection.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical modules, i.e., may be located in one place, or may be distributed over multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment of the application.
In addition, each functional module in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The integrated modules may be implemented in hardware or in software functional modules.
The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method in the various embodiments of the present application. The storage medium includes a U disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The terms "first," "second," and the like in this disclosure are used for distinguishing between similar elements or items having substantially the same function and function, and it should be understood that there is no logical or chronological dependency between the terms "first," "second," and "n," and that there is no limitation on the amount and order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another element. For example, a first offset distance may be referred to as a second offset distance, and similarly, a second offset distance may be referred to as a first offset distance without departing from the scope of the various examples.
It should also be understood that, in the embodiments of the present application, the sequence number of each process does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiments of the present application.
The term "at least one" in the present application means one or more, and the term "plurality" in the present application means two or more, for example, a plurality of first data packets means two or more first data packets. The terms "system" and "network" are often used interchangeably herein.
It is to be understood that the terminology used in the description of the various examples described herein is for the purpose of describing particular examples only and is not intended to be limiting. As used in the description of the various described examples and in the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It will also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and/or" is an association relation describing an associated object, and indicates that three kinds of relations may exist, for example, a and/or B, and may indicate that a exists alone, a and B exist together, and B exists alone. In the present application, the character "/" generally indicates that the front and rear related objects are an or relationship.
It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the terms "if" and "if" may be interpreted to mean "when" ("white" or "upon") or "in response to a determination" or "in response to detection. Similarly, the phrase "if determined" or "if [ a stated condition or event ] is detected" may be interpreted to mean "upon determination" or "in response to determination" or "upon detection of [ a stated condition or event ] or" in response to detection of [ a stated condition or event ] "depending on the context.
It should be appreciated that determining B from a does not mean determining B from a alone, but may also determine B from a and/or other information.
It should be further appreciated that reference throughout this specification to "one embodiment," "an embodiment," "one possible implementation" means that a particular feature, structure, or characteristic described in connection with the embodiment or implementation is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment," "one possible implementation" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
The above description is only of alternative embodiments of the present application and is not intended to limit the present application, and any modifications, equivalent substitutions, improvements, etc. made within the principle of the present application should be included in the protection scope of the present application.
Claims (21)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410258299.4A CN120614089A (en) | 2024-03-06 | 2024-03-06 | Data transmission method, device, equipment, system, storage medium and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410258299.4A CN120614089A (en) | 2024-03-06 | 2024-03-06 | Data transmission method, device, equipment, system, storage medium and program product |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN120614089A true CN120614089A (en) | 2025-09-09 |
Family
ID=96925226
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410258299.4A Pending CN120614089A (en) | 2024-03-06 | 2024-03-06 | Data transmission method, device, equipment, system, storage medium and program product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN120614089A (en) |
-
2024
- 2024-03-06 CN CN202410258299.4A patent/CN120614089A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11792114B2 (en) | System and method for facilitating efficient management of non-idempotent operations in a network interface controller (NIC) | |
| US9049218B2 (en) | Stateless fibre channel sequence acceleration for fibre channel traffic over Ethernet | |
| US20190200273A1 (en) | Flushing PDCP Packets To Reduce Network Load In Multi-Connectivity Scenarios | |
| US8792489B2 (en) | Communication transport protocol for distributed information technology architectures | |
| US9866351B2 (en) | Communication method and communication apparatus | |
| CN108881008A (en) | A method, device and system for data transmission | |
| CN103098428A (en) | Message transmission method, device, system and storage medium realizing pcie switching network | |
| US20250310230A1 (en) | Data transmission method, apparatus, and device, and computer-readable storage medium | |
| WO2024230547A1 (en) | Data transmission method, apparatus, device and computer-readable storage medium | |
| WO2020073907A1 (en) | Method and apparatus for updating forwarding entry | |
| US20250286926A1 (en) | Data transmission method, apparatus, device, and system, and storage medium | |
| CN107995315B (en) | Method and device for synchronizing information between service boards, storage medium and computer equipment | |
| WO2021208694A1 (en) | Data transmission method and network device | |
| WO2025077578A1 (en) | Message transmission method and apparatus, device and computer-readable storage medium | |
| CN116032421B (en) | Ethernet link control device and storage medium | |
| CN118869777A (en) | A RDMA network data processing method and system based on driver middleware | |
| CN120614089A (en) | Data transmission method, device, equipment, system, storage medium and program product | |
| CN118199824A (en) | Data transmission method, device, equipment, system and storage medium | |
| US8854957B2 (en) | Packet retransmission control system, packet retransmission control method and retransmission control program | |
| CN120658671A (en) | Data transmission method, device, equipment, system and storage medium | |
| CN120583046A (en) | Congestion information notification method, device and system | |
| KR102536942B1 (en) | TOE-Based Network Interface Card And Network Interface Method | |
| CN116800855A (en) | Transmission connection switching method and network equipment | |
| CN120050226A (en) | Message transmission method, device, equipment, system and storage medium | |
| CN120407497A (en) | Data transmission system, method, device, storage medium and computer program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination |