A data transmission method based on a sliding window, a network card device, and a storage medium
By dividing the sliding window into multiple data segments and controlling the movement of the sliding window based on the confirmation status of the data segments, the problem of low network card throughput in the prior art is solved, and efficient utilization of storage resources and data transmission efficiency are achieved.
Patent Information
- Application Number
- CN202010398684.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-12
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2040-05-12
AI Technical Summary
The existing sliding window mechanism causes the network card throughput to decrease in data transmission, requiring the creation of large sliding windows to consume a large amount of storage resources, and cannot be moved in time when the datagram is not transmitted successfully.
Divide the sliding window into multiple data segments, each data segment is associated with multiple datagrams, and the movement of the sliding window is controlled through the confirmation status of the data segment, and the confirmed or submitted data segments are timely reused to expand the sliding window.
It improves the throughput of the network card, reduces the consumption of storage resources, and avoids the stagnation of sliding windows in the event of packet loss, improving data transmission efficiency.
Smart Images

Figure CN113660066B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data communication, and particularly to a data transmission method based on a sliding window, a network card device, and a storage medium. Background Art
[0002] In recent years, the market demand for data centers and clouds has grown rapidly, and providing high-performance cloud computing services has become an important topic. The network has an important impact on the performance of data centers and cloud computing. RoCE can not only adapt to the current Ethernet switching devices in data centers but also provide high bandwidth and low latency characteristics, which is an important technology for improving the performance of data center networks. Among them, RoCE (RDMA over Converged Ethernet) is a network protocol that allows the use of remote direct memory access (RDMA) over Ethernet.
[0003] Based on the RoCE network card, flow control and reliable retransmission can be achieved by creating a sliding window in the network card hardware. However, the existing sliding window usually adopts a boundary sliding mechanism. The sending window will move the left boundary of the sending window only when all the acknowledgment messages (ACKs) of the data packets at the front end (left side of the window) of the window are received, and the receiving window will move the left boundary of the receiving window only when all the data packets at the front end of the window are acknowledged. In this way, in some cases where the data packets are not transmitted successfully, the sliding window cannot move in time, resulting in a decrease in the throughput of the network card. If the throughput is to be increased, it is necessary to create a large sliding window, which requires more network card storage resources. Summary of the Invention
[0004] In view of the above problems, the present invention is proposed to provide a data transmission method based on a sliding window, a network card device, and a storage medium that overcome or at least partially solve the above problems.
[0005] According to one aspect of the present invention, there is provided a data transmission method based on a sliding window, where the sliding window is associated with multiple data segments, and at least one data segment is associated with multiple data packets. The method includes:
[0006] Transmitting the unacknowledged data packets in the sliding window;
[0007] When an acknowledgment message for a data packet is received, mark the data packet as acknowledged;
[0008] Determine whether all the data packets in the data segment where the data packet is located are marked as acknowledged. If so, associate the data segment with multiple new data packets. If not, wait for the next acknowledgment message.
[0009] Optionally, according to the data transmission method of the present invention, when receiving an acknowledgment message for a datagram, marking the datagram as acknowledged includes: when receiving an acknowledgment message for a datagram, determining whether the datagram is within the sliding window; if so, marking the datagram as acknowledged; if not, not performing the marking operation and waiting to receive the next acknowledgment message.
[0010] Optionally, according to the data transmission method of the present invention, marking the datagram as acknowledged includes: determining whether the datagram has been marked as acknowledged; if so, not performing the marking operation and waiting to receive the next acknowledgment message. If not, marking the datagram as acknowledged and performing the step of determining whether all datagrams in the data segment where the datagram is located have been marked as acknowledged.
[0011] Optionally, according to the data transmission method of the present invention, the description information of the data segment is recorded by segment metadata, and the segment metadata includes a segment pointer, a segment offset, a segment length, and a segment bitmap. The segment pointer points to the position of the data segment in the storage resource, the segment offset records the sequence number of the starting datagram of the data segment, the segment length records the number of datagrams included in the data segment, and the segment bitmap records the status of the datagrams in the data segment.
[0012] Optionally, according to the data transmission method of the present invention, the segment bitmap includes a plurality of data bits corresponding to the datagrams, and different values of the data bits correspond to different statuses of the datagrams.
[0013] Optionally, according to the data transmission method of the present invention, the status of the datagram includes: not sent; sent, not acknowledged; sent, acknowledged.
[0014] According to another aspect of the present invention, there is provided a data transmission method based on a sliding window. The sliding window is associated with a plurality of data segments, and at least one data segment is associated with a plurality of datagrams. The method includes:
[0015] When receiving a datagram, submitting the datagram and marking the datagram as submitted;
[0016] Determining whether all datagrams in the data segment where the datagram is located have been marked as submitted. If so, associating the data segment with a plurality of new datagrams;
[0017] Sending an acknowledgment message for the datagram.
[0018] Optionally, according to the data transmission method of the present invention, when receiving a datagram, submitting the datagram includes: when receiving a datagram, determining whether the datagram is within the sliding window; if so, submitting the datagram; if not, discarding the datagram and waiting to receive the next datagram.
[0019] Optionally, according to the data transmission method of the present invention, before the step of submitting the datagram, it further includes: determining whether the datagram has been marked as submitted, and if so, not performing the submission operation and performing the step of sending an acknowledgment message for the datagram.
[0020] Optionally, according to the data transmission method of the present invention, the description information of the data segment is recorded by segment metadata, and the segment metadata includes a segment pointer, a segment offset, a segment length, and a segment bitmap. The segment pointer points to the position of the data segment in the storage resource, the segment offset records the sequence number of the starting datagram of the data segment, the segment length records the number of datagrams included in the data segment, and the segment bitmap records the status of the datagrams in the data segment.
[0021] Optionally, according to the data transmission method of the present invention, the segment bitmap includes a plurality of data bits corresponding to the datagrams, and different values of the data bits correspond to different statuses of the datagrams.
[0022] Optionally, according to the data transmission method of the present invention, the status of the datagram includes: not received; received but not submitted; received and submitted.
[0023] According to another aspect of the present invention, there is provided a network card device based on a sliding window. The sliding window is associated with a plurality of data segments, and at least one data segment is associated with a plurality of datagrams. The network card device includes: a transceiver adapted to send unacknowledged datagrams in the sliding window and receive an acknowledgment message for the datagram; a processor adapted to perform: when receiving an acknowledgment message for the datagram, marking the datagram as acknowledged; determining whether all the datagrams in the data segment where the datagram is located are marked as acknowledged, and if so, associating the data segment with a plurality of new datagrams, and if not, waiting to receive the next acknowledgment message.
[0024] Optionally, according to the network card device of the present invention, the processor is further adapted to: when receiving an acknowledgment message for the datagram, determining whether the datagram is within the sliding window, and if so, marking the datagram as acknowledged, and if not, not performing the marking operation and waiting to receive the next acknowledgment message.
[0025] Optionally, according to the network card device of the present invention, before marking the datagram as acknowledged, the processor first determines whether the datagram has been marked as acknowledged. If so, it does not perform the marking operation and waits to receive the next acknowledgment message. If not, it marks the datagram as acknowledged and further determines whether all the datagrams in the data segment where the datagram is located are marked as acknowledged.
[0026] According to another aspect of the present invention, there is provided a network card device based on a sliding window, the sliding window being associated with a plurality of data segments, and at least one data segment being associated with a plurality of data packets. The network card device includes:
[0027] A transceiver adapted to receive a data packet and send an acknowledgment message for the data packet;
[0028] A processor adapted to execute:
[0029] When a data packet is received, submit the data packet and mark the data packet as submitted;
[0030] Determine whether all data packets in the data segment where the data packet is located are marked as submitted. If so, associate the data segment with a plurality of new data packets;
[0031] Instruct the transceiver to send an acknowledgment message for the data packet.
[0032] Optionally, in the network card device according to the present invention, the processor is further adapted to: when a data packet is received, determine whether the data packet is within the sliding window. If so, submit the data packet. If not, discard the data packet and wait for the next data packet to be received.
[0033] Optionally, in the network card device according to the present invention, before submitting the data packet, the processor first determines whether the data packet has been marked as submitted. If so, do not perform the submission operation and instruct the transceiver to send an acknowledgment message for the data packet.
[0034] According to another aspect of the present invention, there is provided a network device including the above-mentioned network card device.
[0035] According to another aspect of the present invention, there is provided a data transmission system including a sending device and a receiving device, and the sending device and the receiving device adopt the above-mentioned network device.
[0036] According to another aspect of the present invention, there is provided a readable storage medium storing program instructions, which when read and executed by a computing device, cause the computing device to execute the above-mentioned method.
[0037] According to the data transmission solution of the present invention, the sliding window is divided into multiple data segments, each data segment includes multiple data packets, and the movement of the sliding window is controlled based on the data segments. When all the data packets in a certain data segment are confirmed (for the sending window) or all are committed (for the receiving window), the data segment is multiplexed, that is, the data segment is associated with multiple new data packets, so that the sliding window can move backward in time, which is equivalent to creating a larger sliding window using limited storage resources, and is beneficial to the improvement of the network card throughput. In addition, when packet loss occurs, the sliding window is extended by multiplexing the data segment, avoiding the stagnation of the sliding window.
[0038] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable, the following specific embodiments of the present invention are specifically given. Brief Description of the Drawings
[0039] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. Moreover, throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0040] Figure 1 A schematic diagram of an application scenario 100 of an embodiment of the present invention is shown;
[0041] Figure 2 A schematic diagram of a sliding window structure based on data segments in an embodiment of the present invention is shown;
[0042] Figure 3 A flowchart of a sending end sliding window control method 300 in an embodiment of the present invention is shown;
[0043] Figure 4 A flowchart of a receiving end sliding window control method 400 in an embodiment of the present invention is shown;
[0044] Figure 5 An example of a sending end sliding window based on data segments is shown;
[0045] Figure 6 An example of a receiving end sliding window based on data segments is shown;
[0046] Figure 7 A schematic block diagram of a network card device 700 according to an embodiment of the present invention is shown;
[0047] Figure 8 A schematic block diagram of a network card device 800 according to another embodiment of the present invention is shown. Detailed Implementation Modes
[0048] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0049] Figure 1 A schematic diagram of an application scenario 100 according to an embodiment of the present invention is shown. As Figure 1 shown, the application scenario 100 according to the embodiment of the present invention is for data transmission between a sending device 110 and a receiving device 120, and the sending device 110 communicates with the receiving device 120 through a network (such as Ethernet). The sending device 110 and the receiving device 120 can be Ethernet switching devices or other types of network devices. The sending device 110 has an application 1102 and a network card 1106, and the application 1102 and the network card 1106 are respectively allocated storage resources 1104 and 1108. The receiving device 120 has an application 1202 and a network card 1206, and the application 1202 and the network card 1206 are respectively allocated storage resources 1204 and 1208. The storage resources (buffer) here generally refer to the storage space allocated by the network device in its memory for the network card or the application.
[0050] The data transmission process is as follows: The application 1102 sends a data packet from the storage resource 1104 to the storage resource 1108. The network card 1106 reads the data packet from the storage resource 1108 and sends the read data packet to the storage resource 1208 in the network card 1206. Then, the network card 1206 submits the data packet in the storage resource 1208 to the application 1202, specifically, sends the data packet from the storage resource 1208 to the storage resource 1204.
[0051] To achieve flow control and reliable retransmission of data packets, a sliding window mechanism is usually introduced in the network card. However, the existing sliding window adopts a boundary sliding mechanism. The sending window will move the left boundary of the sending window only when it receives the acknowledgment packets (ACKs) of all the data packets at the front end (the left side of the window) of the window, and the receiving window will move the left boundary of the receiving window only when all the data packets at the front end of the window are acknowledged. In this way, in some cases where the data packets are not successfully transmitted, the sliding window cannot move in time, resulting in a decrease in the throughput of the network card. If the throughput is to be increased, it is necessary to create a large sliding window, which requires more network card storage resources.
[0052] Therefore, the embodiment of the present invention proposes a sliding window control method based on data segments during data transmission, which can timely reuse the network card storage resources to expand the sliding window and improve the network card performance. Specifically, the data packets in the sliding window are divided into multiple data segments (i.e., the sliding window is associated with multiple data segments), and each data segment is respectively associated with multiple data packets. The movement of the sliding window is controlled based on the data segments. When all the data packets in a certain data segment are confirmed (for the sending window) or all are submitted (for the receiving window), the data segment is reused, that is, the data segment is associated with multiple new data packets, so that the sliding window can move backward in time, which is equivalent to creating a larger sliding window using limited storage resources, and is beneficial to the improvement of the network card throughput. In addition, when packet loss occurs, the sliding window is expanded by reusing the data segments, avoiding the stagnation of the sliding window.
[0053] According to the data transmission method of the embodiment of the present invention, the following steps are executed in the sending device (the sending end):
[0054] 1) Send the unconfirmed data packets in the sliding window (the sliding window in the sending device, simply referred to as the sending window);
[0055] The sending end will send the data packets in the order from left to right in the sending window. Here, unconfirmed includes two cases: not sent; sent but not confirmed. In addition, this step is repeatedly executed as long as there are still un-sent data packets in the sliding window, and these data packets will be sent; for the latter case, the sending end can use the method of timed retransmission.
[0056] 2) When receiving the acknowledgment packet for the data packet, mark the data packet as confirmed;
[0057] 3) After marking the data packet as confirmed, judge whether all the data packets in the sliding window data segment where the data packet is located are marked as confirmed. If all the data packets in the data segment are marked as confirmed, associate the data segment with multiple new data packets, that is, reuse the data segment, which is equivalent to moving the sliding window backward;
[0058] 4) If there are still data packets in the data segment that are not marked as confirmed, wait for the next acknowledgment packet, and after receiving the next acknowledgment packet, re-execute the steps starting from step 2).
[0059] According to the data transmission method of the embodiment of the present invention, the following steps are executed in the receiving device (the receiving end):
[0060] 1) When receiving a data packet, submit the data packet, that is, upload the data packet to the upper-layer application and mark the data packet as submitted;
[0061] 2) Determine whether all the data packets in the sliding window (the sliding window in the receiving device, simply referred to as the receiving window) data segment where the data packet is located are marked as submitted. If all the data packets in the data segment are marked as submitted, then associate the data segment with multiple new data packets, that is, reuse the data segment, which is equivalent to moving the sliding window backward, and send an acknowledgment packet for the data packet.
[0062] 3) If there are still data packets in the data segment that are not marked as submitted, directly send an acknowledgment packet for the data packet.
[0063] The following combines Figures 2 to 4 , and details the structure of the sliding window and the sliding window control methods of the sending end and the receiving end.
[0064] Figure 2 shows a schematic diagram of the sliding window structure based on data segments in an embodiment of the present invention. As Figure 2 shown, the sliding window includes multiple data segments (3 are shown in the figure), each data segment includes multiple data packets (4 are shown in the figure), and the description information of the data segment is recorded by segment metadata. The segment metadata includes a segment pointer, a segment offset, a segment length, and a segment bitmap. The segment pointer points to the position of the data segment in the storage resource, the segment offset records the sequence number of the starting data packet of the data segment, the segment length records the number of data packets included in the data segment, and the segment bitmap records the status of the data packets in the data segment.
[0065] At the sending end, the status of the data packet includes: not sent; sent, not acknowledged; sent, acknowledged. At the receiving end, the status of the data packet includes: not received; received, not submitted; received, submitted. These statuses can be recorded in the form of a bitmap (referred to as a segment bitmap in the present invention). Specifically, the segment bitmap includes multiple data bits, each data bit corresponds to a different data packet, and each status of the data packet corresponds to a different value of the data bit.
[0066] Figure 3 shows a flowchart of the sliding window control method 300 at the sending end in an embodiment of the present invention. The feature of method 300 is to reuse the data segment inside the sending window to slide the window. When all the data packets corresponding to a certain data segment in the sending window have been acknowledged by the receiving end, the data segment can be reused to expand the sliding window. Referring to Figure 3 , method 300 specifically includes the following steps:
[0067] In step S310, configure the size of the data segment, in units of the number of data packets. For example, if the data segment size is configured to 4, then each data segment includes 4 data packets.
[0068] In step S320, an acknowledgment message (ack) for the datagram sent by the receiving end is received.
[0069] In step S330, it is determined whether there is a data bit corresponding to the datagram corresponding to the acknowledgment message in the segment bitmap. If it exists, it indicates that the datagram is within the sending window, and step S340 is entered. If it does not exist, it indicates that the datagram is outside the sending window, and step S320 is returned to wait for the next acknowledgment message. Specifically, the segment metadata in the sliding window can be queried according to the ack sequence number (i.e., the sequence number of the datagram being acknowledged), and the data bit corresponding to the ack sequence number in its segment bitmap is searched.
[0070] In step S340, it is determined whether the data bit has been marked as acknowledged (ack-rxed). If it has been marked (the receiving end may repeatedly send ack messages for the same datagram), then step S320 is returned to wait for the next acknowledgment message. Otherwise, step S350 is entered.
[0071] In step S350, the data bit is marked as ack-rxed.
[0072] In step S360, it is determined whether the segment bitmap of the data segment where the acknowledged datagram is located has been all marked as ack-rxed. If so, it indicates that all the datagrams in this data segment have been acknowledged, and step S370 is entered. If not, it indicates that there are still unacknowledged datagrams in this data segment, and step S320 is returned to wait for the next acknowledgment message.
[0073] In step S370, the data segments in the sliding window that are all marked as ack-rxed are reused to create new segment metadata for this data segment, the segment pointer therein is pointed to this data segment, and the segment offset, segment length, and segment bitmap are initialized, thereby realizing the sliding of the sending window. Then, the steps starting from the above step S320 are continued to be executed.
[0074] Figure 4 The flowchart of the receiving-end sliding window control method 400 in the embodiment of the present invention is shown. The characteristics of method 400 are: First, it is necessary to submit datagrams out of order in the sliding window; Second, the data segments in the window where all the submitted datagrams have been submitted are reused to expand the sliding window. Among them, out-of-order submission means that when a datagram is received, it can be submitted to the upper-layer application without waiting for other datagrams with sequence numbers smaller than it.
[0075] Refer to Figure 4 , method 400 specifically includes the following steps:
[0076] In step S410, the size of the data segment is configured, with the number of datagrams as the unit. For example, if the data segment size is configured to be 4, then each data segment includes 4 datagrams.
[0077] In step S420, a datagram sent by the sending end is received.
[0078] In step S430, it is determined whether there is a data bit in the segment bitmap corresponding to the received datagram. If there is, it means that the datagram is within the receiving window, and step S450 is entered; if not, it means that the datagram is outside the receiving window, and step S440 is entered. Specifically, the segment metadata in the sliding window can be queried according to the datagram sequence number, and the data bit corresponding to the datagram sequence number in its segment bitmap is searched for.
[0079] In step S440, the datagram is discarded, and step S420 is returned to wait for the reception of the next datagram.
[0080] In step S450, it is determined whether the data bit has been marked as acknowledged (ack-txed). If it has been marked (there is a possibility that the previously sent ack has been discarded), step S492 is entered; otherwise, step S460 is entered.
[0081] In step S460, the datagram is submitted (uploaded) to the upper-layer application.
[0082] In step S470, the data bit is marked as ack-txed.
[0083] In step S480, it is determined whether all the data bits in the segment bitmap of the data segment where the datagram is located have been marked as ack-txed. If so, it means that all the datagrams in the data segment have been submitted, and step S490 is entered; if not, it means that there are still datagrams in the data segment that have not been submitted, and step S492 is entered.
[0084] In step S490, the data segments in the sliding window that are all marked as ack-txed are reused, new segment metadata is created for the data segment, the segment pointer therein is pointed to the data segment, and the segment offset, segment length, and segment bitmap are initialized, thereby realizing the sliding of the receiving window.
[0085] In step S492, an ack message for the datagram is fed back to the sending end.
[0086] The following gives specific examples of the sliding windows of the sending end and the receiving end.
[0087] Figure 5 An example of the sending-end sliding window based on data segments is shown. Figure 5Among them, (a) shows the state of the sliding window when acknowledgments with sequence numbers from 2 to 7 and from 9 to 11 have been received, and (b) shows the state of the sliding window after the acknowledgment with sequence number 8 has been received. After receiving the acknowledgment with sequence number 8, the corresponding data bit is found in the segment bitmap of the segment metadata at offset 5, and this data bit is marked as ack-rxed. It is checked that all data bits in the data segment at offset 5 have been marked as ack-rxed. Reuse this data segment, create new segment metadata, point the segment pointer therein to this data segment, and initialize the segment offset, segment length, and segment bitmap.
[0088] Figure 6 An example of the receiver sliding window based on data segments is shown. Figure 6 Among them, (a) shows the state of the sliding window when datagrams with sequence numbers from 2 to 7 and from 9 to 11 have been received, and (b) shows the state of the sliding window after the datagram with sequence number 8 has been received. After receiving the datagram with sequence number 8, the corresponding data bit is found in the segment bitmap of the segment metadata at offset 5, and this data bit is marked as ack-txed, and the datagram is uploaded. It is checked that all data bits in the data segment at offset 5 have been marked as ack-txed. Reuse this data segment, create new segment metadata, point the segment pointer therein to this data segment, and initialize the segment offset, segment length, and segment bitmap, and finally return an ack message.
[0089] The above method 200 and method 300 can be executed in a network device, specifically in the network card of the network device.
[0090] Figure 7 A schematic block diagram of a network card device 700 according to an embodiment of the present invention is shown. As Figure 7 shown, the network card device 700 includes:
[0091] A transceiver 710, adapted to send unacknowledged datagrams in the sliding window and receive acknowledgment messages for the datagrams;
[0092] A processor 720, adapted to execute:
[0093] When an acknowledgment message for a datagram is received, mark the datagram as acknowledged;
[0094] Judge whether all datagrams in the data segment where the datagram is located are marked as acknowledged. If so, associate the data segment with multiple new datagrams. If not, wait to receive the next acknowledgment message.
[0095] In addition, the network card device 700 may further include a memory 730. The memory 730 may be used to store codes executed by the processor 720 and the like. Each component in the network card device 700 is coupled together through a bus system 740, where the bus system 740 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus.
[0096] Figure 8 FIG. shows a schematic block diagram of a network card device 800 according to another embodiment of the present invention. As Figure 8 shown, the network card device 800 includes:
[0097] A transceiver 810, adapted to receive a data packet and send an acknowledgment message for the data packet;
[0098] A processor 820, adapted to execute:
[0099] When a data packet is received, submit the data packet and mark the data packet as submitted;
[0100] Determine whether all data packets in the data segment where the data packet is located are marked as submitted. If so, associate the data segment with a plurality of new data packets;
[0101] Instruct the transceiver to send an acknowledgment message for the data packet.
[0102] In addition, the network card device 800 may further include a memory 830. The memory 830 may be used to store codes executed by the processor 820 and the like. Each component in the network card device 800 is coupled together through a bus system 840, where the bus system 840 includes, in addition to a data bus, a power bus, a control bus, and a status signal bus.
[0103] The various technologies described herein may be implemented in combination with hardware or software, or a combination thereof. Thus, the method and device of the present invention, or certain aspects or parts of the method and device of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium. When the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0104] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute the method of the present invention according to the instructions in the program code stored in the memory.
[0105] By way of example, and not limitation, a readable medium includes a readable storage medium and a communication medium. The readable storage medium stores information such as computer readable instructions, data structures, program modules or other data. The communication medium generally embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism, and includes any information delivery medium. A combination of any of the above is also included within the scope of the readable medium.
[0106] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. A variety of general purpose systems may also be used with examples of the present invention. The structure required to construct such systems will be apparent from the above description. Additionally, the present invention is not directed to any particular programming language. It should be understood that the present invention as described herein can be implemented using various programming languages, and the description of a particular language above is for the purpose of disclosing the preferred embodiments of the present invention.
[0107] In the specification provided herein, numerous specific details are set forth. However, it can be understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0108] Similarly, it should be understood that in order to streamline this disclosure and assist in understanding one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as reflected in the following claims, the inventive aspects lie in less than all the features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of the present invention.
[0109] Those skilled in the art should understand that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices as described in the embodiments, or alternatively may be located in one or more devices different from the devices in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple sub-modules.
[0110] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be adopted to combine all the features disclosed in this specification (including the accompanying claims, abstract and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise explicitly stated, each feature disclosed in this specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature that provides the same, equivalent or similar purpose.
[0111] In addition, those skilled in the art can understand that although some of the embodiments described herein include certain features included in other embodiments rather than other features, the combination of features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
[0112] In addition, some of the embodiments herein are described as combinations of methods or method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Therefore, a processor having the necessary instructions for implementing the method or method element forms a device for implementing the method or method element. In addition, the elements described herein in the device embodiments are examples of such devices: the device is used to implement the functions performed by the elements for the purpose of implementing the invention.
[0113] As used herein, unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe ordinary objects only indicates different instances of similar objects, and does not intend to imply that the objects so described must have a given order in terms of time, space, sorting, or in any other way.
[0114] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art, having the benefit of the foregoing description, will appreciate that other embodiments can be devised within the scope of the invention as thus described. Additionally, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes and not to limit or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure herein is illustrative and not restrictive, and the scope of the invention is defined by the appended claims.
Claims
1. A data transmission method based on a sliding window, where the sliding window is associated with multiple data segments, and at least one data segment is associated with multiple data packets. The method includes: Transmitting unacknowledged data packets in the sliding window; When an acknowledgment packet for a data packet is received, marking the data packet as acknowledged; Determining whether all data packets in the data segment where the data packet is located are marked as acknowledged. If so, associating the data segment with multiple new data packets. If not, waiting to receive the next acknowledgment packet.
2. The method according to claim 1, wherein, When an acknowledgment packet for a data packet is received, marking the data packet as acknowledged includes: When an acknowledgment packet for a data packet is received, determining whether the data packet is within the sliding window; If so, marking the data packet as acknowledged; If not, not performing the marking operation and waiting to receive the next acknowledgment packet.
3. The method according to claim 2, wherein Marking the data packet as acknowledged includes: Determining whether the data packet has been marked as acknowledged; If so, not performing the marking operation and waiting to receive the next acknowledgment packet; If not, marking the data packet as acknowledged and performing the step of determining whether all data packets in the data segment where the data packet is located are marked as acknowledged.
4. The method according to any one of claims 1 to 3, wherein The description information of the data segment is recorded by segment metadata, and the segment metadata includes a segment pointer, a segment offset, a segment length, and a segment bitmap. The segment pointer points to the position of the data segment in the storage resource. The segment offset records the sequence number of the starting data packet of the data segment. The segment length records the number of data packets included in the data segment. The segment bitmap records the status of the data packets in the data segment.
5. The method according to claim 4, wherein, The segment bitmap includes multiple data bits corresponding to the data packets, and different values of the data bits correspond to different statuses of the data packets.
6. The method according to claim 5, wherein, The statuses of the data packets include: not sent; sent, not acknowledged; sent, acknowledged.
7. A data transmission method based on a sliding window, where the sliding window is associated with multiple data segments, and at least one data segment is associated with multiple data packets. The method includes: When a data packet is received, submitting the data packet and marking the data packet as submitted; Determining whether all data packets in the data segment where the data packet is located are marked as submitted. If so, associating the data segment with multiple new data packets; Sending an acknowledgment packet for the data packet.
8. The method according to claim 7, wherein, When a data packet is received, submitting the data packet includes: When a data packet is received, determining whether the data packet is within the sliding window; If so, submitting the data packet; If not, discarding the data packet and waiting to receive the next data packet.
9. The method according to claim 8, wherein Before the step of submitting the data packet, it further includes: Determining whether the data packet has been marked as submitted. If so, not performing the submission operation and performing the step of sending an acknowledgment packet for the data packet.
10. The method according to any one of claims 7 to 9, wherein The description information of the data segment is recorded by segment metadata, and the segment metadata includes a segment pointer, a segment offset, a segment length, and a segment bitmap. The segment pointer points to the position of the data segment in the storage resource. The segment offset records the sequence number of the starting data packet of the data segment. The segment length records the number of data packets included in the data segment. The segment bitmap records the status of the data packets in the data segment.
11. The method according to claim 10, wherein, The rank diagram includes multiple data bits corresponding to data packets, and different values of the data bits correspond to different states of the data packets.
12. The method according to claim 11, wherein, The states of the data packets include: not received; received but not submitted; received and submitted.
13. A network card device based on a sliding window, the sliding window is associated with multiple data segments, and at least one data segment is associated with multiple data packets. The network card device includes: A transceiver, adapted to send unacknowledged data packets in the sliding window and receive acknowledgment packets for the data packets; A processor, adapted to execute: When an acknowledgment packet for a data packet is received, mark the data packet as acknowledged; Determine whether all data packets in the data segment where the data packet is located are marked as acknowledged. If so, associate the data segment with multiple new data packets. If not, wait for the next acknowledgment packet to be received.
14. The network card device according to claim 13, wherein, The processor is further adapted to: when an acknowledgment packet for a data packet is received, determine whether the data packet is within the sliding window. If so, mark the data packet as acknowledged. If not, do not perform the marking operation and wait for the next acknowledgment packet to be received.
15. The network card device according to claim 14, wherein, Before marking the data packet as acknowledged, the processor first determines whether the data packet has been marked as acknowledged. If so, do not perform the marking operation and wait for the next acknowledgment packet to be received. If not, mark the data packet as acknowledged and further determine whether all data packets in the data segment where the data packet is located are marked as acknowledged.
16. A network card device based on a sliding window, the sliding window is associated with multiple data segments, and at least one data segment is associated with multiple data packets. The network card device includes: A transceiver, adapted to receive data packets and send acknowledgment packets for the data packets; A processor, adapted to execute: When a data packet is received, submit the data packet and mark the data packet as submitted; Determine whether all data packets in the data segment where the data packet is located are marked as submitted. If so, associate the data segment with multiple new data packets; Instruct the transceiver to send an acknowledgment packet for the data packet.
17. The network card device according to claim 16, wherein, The processor is further adapted to: When a data packet is received, determine whether the data packet is within the sliding window. If so, submit the data packet. If not, discard the data packet and wait for the next data packet to be received.
18. The network card device according to claim 17, wherein, Before submitting the data packet, the processor first determines whether the data packet has been marked as submitted. If so, do not perform the submission operation and instruct the transceiver to send an acknowledgment packet for the data packet.
19. A network device, including the network card device according to any one of claims 13 to 15.
20. A network device, including the network card device according to any one of claims 16 to 18.
21. A data transmission system, including a sending device and a receiving device. The sending device uses the network device according to claim 19, and the receiving device uses the network device according to claim 20.
22. A readable storage medium storing program instructions, when the program instructions are read and executed by a computing device, cause the computing device to execute the method according to any one of claims 1 - 12.
Citation Information
Patent Citations
Streaming data transmission control method
CN110324256A
Retransmission and memory consumption tracking of data packets in a network device
US20150063358A1