CN108234087B - Data transmission method and sending end - Google Patents

Data transmission method and sending end Download PDF

Info

Publication number
CN108234087B
CN108234087B CN201611201236.7A CN201611201236A CN108234087B CN 108234087 B CN108234087 B CN 108234087B CN 201611201236 A CN201611201236 A CN 201611201236A CN 108234087 B CN108234087 B CN 108234087B
Authority
CN
China
Prior art keywords
packet
sequence number
data
data packet
sending
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.)
Active
Application number
CN201611201236.7A
Other languages
Chinese (zh)
Other versions
CN108234087A (en
Inventor
武庆华
閤先军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201611201236.7A priority Critical patent/CN108234087B/en
Publication of CN108234087A publication Critical patent/CN108234087A/en
Application granted granted Critical
Publication of CN108234087B publication Critical patent/CN108234087B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • H04L1/1671Details of the supervisory signal the supervisory signal being transmitted together with control information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1858Transmission or retransmission of more than one copy of acknowledgement message

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Communication Control (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

The invention provides a data transmission method applied to a sending end and the sending end. The sending end sends a data packet to a receiving end, and the sent data packet comprises a data sequence number and a sending sequence number. And after receiving the data packet, the receiving end generates a confirmation packet, acquires a sending sequence number of the data packet, adds the acquired sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end. And the sending end receives the confirmation packet sent by the receiving end, and determines whether a retransmission data packet exists in the data packet sent before the data packet according to the sending sequence number in the confirmation packet, wherein the retransmission data packet is the data packet needing to be retransmitted. If yes, the sending end acquires the retransmitted data packet and sends the retransmitted data packet to the receiving end, and the sending sequence number of the retransmitted data packet is the sending sequence of the retransmitted data packet. Therefore, overtime retransmission can be reduced, and the efficiency of data transmission is improved.

Description

Data transmission method and sending end
Technical Field
The present invention relates to the field of computers, and in particular, to a data transmission method and a transmitting end.
Background
TCP is a core protocol of modern network transmission, packet loss recovery is a key in TCP transmission performance, and especially in a scenario where a data stream transmitted by a transmitting end and a receiving end is relatively short or a packet loss rate is relatively high, the efficiency of packet loss recovery directly determines the transmission performance.
The principle of the timeout retransmission is that a timer is started after a data packet is sent, and if an Acknowledgement (ACK) message of the sent data packet is not obtained within a certain time, the data is retransmitted until the data is successfully sent. However, the time for Retransmission Timeout (RTO) is long (1 second is specified in the TCP protocol, and 200 milliseconds is minimum in the Linux kernel implementation). In addition, during the period of recovering packet loss through timeout retransmission, a new data packet is not transmitted, so that the throughput in this period is reduced to 0, and after the timeout retransmission, the congestion window of data transmission is reduced to 1, and the slow start stage is entered, so that excessive timeout retransmission causes the throughput to be seriously reduced, and the flow completion time is seriously increased.
Disclosure of Invention
Embodiments of the present invention provide a data transmission method, which is used to improve transmission efficiency by reducing or avoiding retransmission due to timeout.
A first aspect of an embodiment of the present invention provides a data transmission method applied to a sending end. The transmitting end may transmit a data stream to a receiving end. By executing the method, the sending end sends a data packet to a receiving end, the sent data packet comprises a data sequence number and a sending sequence number, the data sequence number represents the sequence of the sent data packet in the data stream, and the sending sequence number represents the sending sequence of the data packet. And after receiving the data packet, the receiving end generates a confirmation packet, acquires a sending sequence number of the data packet, adds the acquired sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end. And the sending end receives the confirmation packet sent by the receiving end, and determines whether a retransmission data packet exists in the data packet sent before the data packet according to the sending sequence number in the confirmation packet, wherein the retransmission data packet is the data packet needing to be retransmitted. If yes, the sending end acquires the retransmitted data packet and sends the retransmitted data packet to the receiving end, and the sending sequence number of the retransmitted data packet is the sending sequence of the retransmitted data packet.
The sending end adds the sending serial number to the transmitted data packet, and the receiving end obtains the sending serial number in the data packet after receiving the data packet and adds the obtained sending serial number to the confirmation packet, so that the sending end can determine the lost data packet and the data packet needing to be retransmitted according to whether the sending serial number in the confirmation packet is continuous, and overtime retransmission of data can be effectively reduced.
Before data transmission is carried out between a receiving end and a sending end, connection needs to be established, when the connection is established, the sending end adds first indication information in a connection packet sent to the receiving end to indicate that a data packet sent by the receiving end comprises a sending serial number, therefore, when the receiving end judges that the received connection packet comprises the indication information and a confirmation packet sent by the receiving end also comprises the sending serial number, a response packet is generated, second indication information is added in the response packet to indicate that the confirmation packet sent by the receiving end comprises the sending serial number of the data packet corresponding to the confirmation packet, the sending end receives the response packet sent by the receiving end, and if the response packet comprises the second indication information, the sending serial number is added when the data packet is sent subsequently.
When the connection is established between the sending end and the receiving end, the first indication information and the second indication information tell the opposite side, and the local end supports a data transmission mode of adding a sending sequence number in a data packet, so that the sending sequence number can be added in the data packet when data transmission is carried out, and the overtime retransmission of data is reduced.
When determining whether a retransmitted data packet exists in a data packet transmitted before the data packet according to a transmission sequence number in the acknowledgement packet, firstly, determining whether a first discontinuous packet is included in the first N acknowledgement packets of the currently received acknowledgement packet according to the transmission sequence number, where the transmission sequence number of the first discontinuous packet is discontinuous with the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet, where N is a retransmission threshold and is a natural number greater than 1, if so, determining whether a difference between the transmission sequence number of the currently received acknowledgement packet and the transmission sequence number of the first discontinuous packet is greater than or equal to the retransmission threshold N, and if so, determining that a retransmitted data packet exists in the data packet transmitted before the data packet.
Therefore, the retransmission data packet can be identified in time, and the situation that the retransmission data packet cannot be effectively identified in some scenes is avoided, so that retransmission can be realized only in an overtime retransmission mode, and the efficiency of data transmission is improved.
After the data packet is sent to the receiving end, the mapping relation between the data sequence number of the data packet and the sending sequence number is recorded, so that when the retransmitted data packet is obtained, the missing sending sequence number between the sending sequence number of the first discontinuous packet and the sending sequence number of the previous confirmation packet of the first discontinuous packet can be firstly determined, the data sequence number of the retransmitted data packet can be obtained according to the determined missing sending sequence number and the mapping relation between the data sequence number of the data packet and the sending sequence number, and then the retransmitted data packet is obtained according to the data sequence number.
Therefore, the retransmission data packet can be quickly found, and the data retransmission efficiency is improved.
A second aspect of the embodiments of the present invention provides a data transmission method applied to a receiving end, where the receiving end receives a data packet sent by a sending end, where the data packet includes a data sequence number and a sending sequence number, the data sequence number indicates an order of the sent data packet in a data stream, the sending sequence number indicates a sending order of the data packet, then generates a confirmation packet, obtains the sending sequence number of the data packet, adds the obtained sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end, so that the sending end determines, according to the sending sequence number in the confirmation packet, whether a retransmission data packet exists in a data packet sent before the data packet, where the retransmission data packet is a data packet that needs to be retransmitted. If yes, the sending end obtains the retransmitted data packet and sends the retransmitted data packet to the receiving end.
A third aspect of the embodiments of the present invention provides a sending end, where the sending end transmits a data stream to a receiving end. The sending end comprises a sending module, a confirming module and a retransmitting module. The sending module is used for sending a data packet to a receiving end, the sent data packet comprises a data sequence number and a sending sequence number, the data sequence number represents the sequence of the sent data packet in the data stream, the sending sequence number represents the sending sequence of the data packet, so that the receiving end generates a confirmation packet after receiving the data packet, obtains the sending sequence number of the data packet, adds the obtained sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end. The confirmation module is used for receiving a confirmation packet sent by the receiving end, and determining whether a retransmission data packet exists in a data packet sent before the data packet according to a sending sequence number in the confirmation packet, wherein the retransmission data packet is a data packet needing to be retransmitted. The retransmission module is configured to acquire the retransmitted data packet and transmit the retransmitted data packet to the receiving end, where a transmission sequence number of the retransmitted data packet is a transmission sequence of the retransmitted data packet.
The sending end further comprises a connection module, the connection module is used for sending a connection packet to the receiving end, the connection packet comprises first indication information, the first indication information indicates that the data packet sent by the receiving end comprises the sending serial number, so that when the receiving end judges that the received connection packet comprises the indication information and the acknowledgement packet sent by the receiving end also comprises the sending serial number, a response packet is generated, the response packet comprises second indication information, and the second indication information indicates that the acknowledgement packet sent by the receiving end comprises the sending serial number of the data packet corresponding to the acknowledgement packet; and the receiving end is further configured to receive a response packet sent by the receiving end, and if the response packet includes the second indication information, add the sending sequence number in subsequent sending of the data packet.
The acknowledgement module is specifically configured to determine, according to a transmission sequence number in the acknowledgement packet, whether a retransmission data packet exists in a data packet transmitted before the data packet, whether a first discontinuous packet is included in first N acknowledgement packets of a currently received acknowledgement packet according to the transmission sequence number, where the transmission sequence number of the first discontinuous packet is discontinuous with a transmission sequence number of a previous acknowledgement packet of the first discontinuous packet, where N is a retransmission threshold and is a natural number greater than 1; if yes, judging whether the difference value between the sending sequence number of the currently received confirmation packet and the sending sequence number of the first discontinuous packet is larger than or equal to the retransmission threshold value N; and if so, determining that the retransmitted data packet exists in the data packets transmitted before the data packet.
The recording step may further include a recording module, configured to record a mapping relationship between a data sequence number of the data packet and the transmission sequence number after the data packet is transmitted to the receiving end, and the retransmission module, when acquiring the retransmitted data packet, is specifically configured to: determining a missing transmission sequence number between the transmission sequence number of the first discontinuous packet and the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet; acquiring a data sequence number of the retransmission data packet according to the determined missing sending sequence number and the mapping relation between the data sequence number of the data packet and the sending sequence number; and acquiring the retransmission data packet according to the data sequence number.
According to the technical scheme provided by the embodiment of the invention, the sending end adds the sending serial number to the transmitted data packet, and the receiving end acquires the sending serial number in the data packet after receiving the data packet and adds the acquired sending serial number to the confirmation packet, so that the sending end can determine the lost data packet and the data packet needing to be retransmitted according to whether the sending serial number in the confirmation packet is continuous, and the overtime retransmission of the data can be effectively reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of data transmission in a scenario of retransmission data loss in the prior art.
Fig. 2 is a schematic diagram of data transmission in a situation where continuous data is lost and data is lost in the prior art.
Fig. 3 is an architecture diagram of a data transmission system and a structure diagram of a transmitting end and a receiving end according to an embodiment of the present invention.
Fig. 4 is a flowchart of a data transmission method according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of data transmission in a scenario with data loss after continuous data loss in the embodiment of the present invention.
Fig. 6 is a schematic diagram of data transmission in a scenario in which retransmission data is lost in the embodiment of the present invention.
Fig. 7 is a block diagram of a transmitting end in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
According to Transmission Control Protocol/Internet Protocol (TCP/IP), a Transmission data stream between a receiving end and a transmitting end is divided into a plurality of data packets, each data packet includes a data sequence number to indicate its position in the data stream when the data packets are transmitted, when the receiving end receives a data packet, an acknowledgement packet (ACK packet) is replied to the transmitting end for the received data packet, the acknowledgement packet includes an ACK number, the ACK number is the data sequence number of the data packet received by the receiving end plus 1 to tell the transmitting end that the previous data packet of the ACK number has been received, and what needs to be received at present is the data packet whose data sequence number is the ACK number. When the receiving end sends the acknowledgement packet, if the data sequence number of the currently received data packet is not continuous with the sequence number of the previously received data packet, that is, the data packet sent later is received first, but the data packet sent first is possibly lost, at this time, the ACK number of the acknowledgement packet sent by the receiving end is consistent with the ACK number of the previously received data packet of the currently received data packet. If the data packet subsequently received by the receiving end is not the possible lost packet, the ACK number in the acknowledgement packet of the subsequently received data packet remains unchanged until the possible lost packet is received. At the transmitting end, if three acknowledgement packets with consistent ACK numbers (which are preset retransmission thresholds or may be set to other values) are continuously received, it can be determined that the data packet with the sequence number of the ARC number may be lost, and needs to be retransmitted quickly, so that the data is retransmitted. As shown in fig. 1, the data packets seq1, seq2, seq3, seq4, seq5, seq6, and seq7 are sequentially transmitted from the sender to the receiver, and the receiver sends an acknowledgement packet ACK2 to the sender when receiving the data packet seq 1. If the data packet seq2 is lost, the receiving end still sends ACK2 to the transmitting end after receiving the subsequent data packets seq3 and seq4 of seq2, and ACK2 carries SACK3 and SACK4, which indicates that the data packets seq3 and seq4 have been received, and after the transmitting end finds that three identical ACKs 2 are received, the transmitting end determines the retransmitted data packet seq2 according to the SACK information contained in the acknowledgement packet and retransmits the data packet seq 2. However, before the receiving end receives the seq2, the acknowledgement packets of the data packets seq5, seq6, seq7 are already sent out, so if a fast retransmission of seq2 is triggered once according to the above-mentioned manner of triggering data retransmission, multiple retransmissions of seq2 will be caused, which wastes communication resources, and therefore, in the prior art, after a fast retransmission of data, a second fast retransmission will not be started. Thus, if the first fast retransmitted packet seq2 is lost again, it can be retransmitted only by timeout, resulting in inefficient transmission of data.
In addition, as shown in fig. 2, if three consecutive data packets are lost in the data transmission process, for example, seq2, seq3, seq4, and a subsequent data packet seq7 is also lost, after the receiving end receives the data packets seq5 and seq6, an acknowledgement packet containing ACK2 and SACK information is sent to the transmitting end for each data packet, and after the transmitting end receives three repeated ACKs 2, the retransmission of the data packets seq2, seq3, seq4 can be triggered. However, since the ACK number of the ACK packet of the retransmitted packet is not repeated, the retransmission of the packet seq7 is not triggered, which results in the timeout retransmission of seq 7.
Therefore, in the existing fast retransmission method, under the situation that retransmission data is lost and a data packet is lost after a continuous data packet is lost, the overtime retransmission of the data packet may be caused, so that the transmission efficiency of the data is influenced.
In the embodiment of the invention, a sending sequence number is added to a data packet, namely each data has a data sequence number indicating the sequence of the data packet and also comprises a sending sequence number, the sending sequence numbers are sequenced according to the sending sequence, after the lost data is retransmitted, the sending sequence numbers are sequenced according to the sequence of the retransmission in the sending sequence, after a receiving end receives the data packet, the sending sequence numbers in the data packet are obtained, and the obtained sending sequence numbers are added into an acknowledgement packet, so that the sending end can judge whether the data retransmission is needed according to the continuous condition of the sending sequence numbers in the received acknowledgement packet, even if the retransmitted data is lost and a data packet is lost continuously, the lost data packet can be retransmitted in time, thereby reducing the overtime retransmission, the transmission efficiency of data is improved. The scheme provided by the invention is described in connection with specific embodiments.
Fig. 3 is a diagram showing an architecture of a data transmission system according to an embodiment of the present invention. The data transmission system includes a transmitting end 30 and a receiving end 31, where the transmitting end 30 and the receiving end 31 are connected through a network 32. The communication protocol of network 32 is the TCP/IP protocol. The sending end 30 may be a server, the receiving end 31 may be a client, the receiving end 31 may send a data access request to the sending end 30, and the sending end 30 responds to the data access request of the receiving end 31 and transmits data accessed by the receiving end 31 to the receiving end 31.
The hardware structure of the transmitting end 30 is similar to that of the receiving end 31, and the transmitting end 30 is taken as an example for description. The transmitting end 30 includes a Central Processing Unit (CPU) 301, a memory 302, and an interface 303. The memory 302 has stored therein an application 304. The CPU executes the application program 304 in the memory 302 to provide corresponding functions for the transmitting end 30, for example, the CPU executes the application program 304 to implement the data transmission method shown in fig. 4, so that the transmitting end and the receiving end perform data transmission.
According to the TCP/IP protocol, before the sending end 30 communicates with the receiving end 31, a connection needs to be established, and when establishing a connection, an identifier field indicating that the connection initiator supports an Osseq mechanism, that is, first indication information, is added to a Synchronization (SYN) packet (also referred to as a connection packet) by a party initiating a connection request. The oseq mechanism is a data retransmission method provided by the embodiment of the present invention, and details about the oseq mechanism will be described below. The field may be added in a reserved field of the SYN packet. For convenience of description, the following will take the example that the sending end 30 initiates the connection request as an example.
After receiving the SYN packet sent by the sending end 30, if the receiving end 31 finds the first indication information at the reserved field of the SYN and also supports the OSSeq mechanism, a response packet is sent to the sending end 30, and the response packet includes the second indication information indicating that the receiving end 31 also supports the OSSeq mechanism. Thus, when both sides confirm that the OSSeq mechanism is supported, the OSSeq mechanism can be used in the subsequent data transmission.
The data packets transmitted through the OSSeq mechanism further include a transmission sequence number in addition to the data sequence number, where the data sequence number is used to indicate an order of the data packets in the transmitted data stream, the transmission sequence number indicates a transmission order of the data packets, and the transmission sequence number may also be set at a reserved field of the data packets.
A method for data transmission through the SSeq mechanism will be described below with reference to fig. 4.
Step S401, the sending end sequentially sends data packets to the receiving end, and when sending a data packet, adds the sending sequence number to the data packet, and records a corresponding relationship between the data sequence number and the sending sequence number.
Step S402, the receiving end receives the data packet, generates a confirmation packet, acquires the sending sequence number in the data packet, adds the acquired sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end.
Step S403, the sending end receives the acknowledgement packet, and obtains a sending sequence number in the acknowledgement packet.
In step S404, the sender determines whether the acknowledgment packet is the first acknowledgment packet of the transmitted data stream. If the packet is the first acknowledgment packet, step S405 is performed, and if the packet is not the first acknowledgment packet, step S407 is performed.
Step S405, determining whether the acknowledgment packet corresponds to the first data packet in the data stream according to the transmission sequence number, if yes, returning to step S403, if not, indicating that data before the data packet corresponding to the acknowledgment packet may be lost, executing step S406, taking the acknowledgment packet as a first discontinuous packet, where the first discontinuous packet is that the transmission sequence number in the acknowledgment packet is discontinuous from the transmission sequence number of the previous acknowledgment packet, and here, if the transmission sequence number of the first acknowledgment packet is not the transmission sequence number of the first data packet in the data stream, also taking the first discontinuous packet as the first discontinuous packet.
Step S407, the sending end determines whether the first N acknowledgement packets of the currently received acknowledgement packet include the first discontinuous packet, if not, returns to step S403, and if so, executes step S408, where N is a retransmission threshold and is a natural number greater than 1.
Step S408, determining whether the difference between the transmission sequence number of the currently received acknowledgement packet and the transmission sequence number of the first discontinuous packet is greater than or equal to the retransmission threshold N, if not, returning to step S403, and if so, executing step S409.
Step S409, determining the missing transmission sequence number between the transmission sequence number of the first discontinuous packet and the transmission sequence number of the previous acknowledgement packet of the first discontinuous packet. It should be noted that, if the first discontinuous packet is the first acknowledgement packet received by the transmitting end, 0 may be defined as the transmission sequence number of the previous acknowledgement packet of the first discontinuous packet by default.
Step S410, obtaining the data sequence number of the lost data packet according to the determined missing transmission sequence number and the relationship between the transmission sequence number and the data sequence number recorded when the data is transmitted.
Step S411, obtaining the lost data packet according to the data sequence number, and retransmitting the lost data packet, wherein the retransmitted data packet is the retransmitted data packet. And adding a sending sequence number into the data packet, and updating the corresponding relation between the data sequence number of the retransmission data packet and the sending sequence number.
Through the technical scheme provided by the embodiment, the sending end adds the sending sequence number to the transmitted data packet, and the receiving end acquires the sending sequence number in the data packet after receiving the data packet and adds the acquired sending sequence number to the confirmation packet, so that the sending end can determine the lost data packet and the data packet needing to be retransmitted according to the continuity of the sending sequence number in the confirmation packet, and the overtime retransmission of the data can be effectively reduced.
The application of the above data transmission method will be described with reference to the examples shown in fig. 5 and 6.
As shown in fig. 5, the sender first sends data packets seq1, seq2, seq3, seq4, seq5, seq6, seq7 to the receiver. When the sender sends a data packet, a sending sequence number is added to each data packet, and the data packets to which the sending sequence numbers are added may be denoted as seq1(1), seq2(2), seq3(3), seq4(4), seq5(5), seq6(6), and seq7(7), where the numbers in parentheses indicate the sending sequence numbers. Seq2, seq3, seq4, and seq7 are lost during the transmission of a packet. After the receiving end receives the data packets, it will acquire the transmission sequence number in the data packet from the received data packet and add the acquired transmission sequence number to the acknowledgement packet, for example, the receiving end receives the data packets seq1(1), seq5(5), seq6(6), and then add the transmission sequence number of each received data packet to the acknowledgement packet corresponding to each data packet, and the acknowledgement packets with the transmission sequence numbers added are Ack2(1), Ack2(5), Ack2(6), it should be noted that, since the data packet seq2(2) has not been received before receiving the data packets seq5(5) and seq6(6), the Ack number in the acknowledgement packet sent by the receiving end is still 2. After the sending end receives the acknowledgement packet, whether the received acknowledgement packet is the first acknowledgement packet is judged, if so, whether the sending sequence number in the acknowledgement packet is the sending sequence number of the first data packet is further determined, if so, the acknowledgement packet is the acknowledgement packet corresponding to the first data packet, and if not, the data packet sent before the data packet corresponding to the current acknowledgement packet is lost. For example, in the present embodiment, if the transmission sequence number in the received first acknowledgement packet is 1, it indicates that the first data packet is not lost. If the acknowledgment packet received by the sending end is not the first acknowledgment packet of the transmitted data stream, the sending end determines whether the sending sequence numbers in the currently received acknowledgment packet and the first N acknowledgment packets of the currently received acknowledgment packet are consecutive, in this embodiment, N is a threshold value for triggering retransmission, and when the sending sequence numbers in the currently received acknowledgment packet and the first N acknowledgment packets of the currently received acknowledgment packet are not consecutive, it is further determined whether a difference value of the sending sequence numbers between the currently received acknowledgment packet and the acknowledgment packet whose sending sequence number is discontinuous for the first time is greater than or equal to a preset value M, where M is N-1. For example, in this embodiment, when the sender receives the Ack2(1), since there is no previous Ack and the transmission sequence number is 1, the first packet with the transmission sequence number is not lost, when the sender receives the Ack2(5), since the transmission sequence number 5 is not consecutive to the previous transmission sequence number 1, the Ack2(5) is a first discontinuous packet, when the Ack2(6) is received, it is determined whether there is the first discontinuous packet in the Ack2(1) and the Ack2(5) which are two Ack packets before the Ack (6) and the Ack (6), and since the Ack2(5) is a first discontinuous packet, it is continuously determined whether the difference between the transmission sequence number of the Ack2(6) and the transmission sequence number of the first discontinuous packet, that is, the Ack2(5), is greater than or equal to 1, and 6-5 is equal to 1, therefore, the retransmission condition is satisfied, the missing transmission sequence number, i.e. 2,3,4, between the transmission sequence number 5 of the Ack2(5) as the first discontinuous packet and the transmission sequence number 1 of the acknowledgement packet Ack2(1) preceding the Ack2(5) as the first discontinuous packet is found, the data sequence number corresponding to the missing transmission sequence number 2,3,4 is found according to the missing sequence number and the corresponding relationship between the transmission sequence number established when transmitting data and the data sequence number of the data packet, and the data packets seq2, seq3, seq4 are found according to the data sequence number for retransmission, and the transmission sequence number is added during retransmission, so that the retransmitted data packets become seq2(8), seq3(9), seq4(10), and the corresponding relationship between the transmission sequence number and the data sequence number of each data packet is established. After receiving seq2(8), seq3(9) and seq4(10), the receiving end will send Ack3(8), Ack4(9) and Ack5(10), and after receiving Ack4(9), the sending end finds that there is a first discontinuous packet seq2(8) between the sending sequence number 9 and the first two acknowledgement packets, and the difference between the sending sequence number and the first discontinuous packet is equal to 1, triggers retransmission, determines that the missing sending sequence number is 7, and retransmits the data packet seq7 corresponding to the missing sending sequence number 7, so that the lost data after the continuous lost data can be retransmitted quickly without waiting for retransmission overtime, thereby improving the efficiency of data transmission.
In addition, it is described with reference to fig. 6 that the data retransmission method provided in fig. 4 can be quickly retransmitted again when the data that is quickly retransmitted for the first time is lost, so that only the retransmission overtime is performed after the data that is quickly retransmitted in the prior art is lost, thereby improving the efficiency of data transmission.
As shown in fig. 6, the sender sends the data packets seq1(1), seq2(2), seq3(3), seq4(4), seq5(5), seq6(6) and seq7(7) with the sending sequence number to the receiver, and if seq2(2) is lost during the sending process, the receiver receives the data packets, and then sequentially sends the acknowledgement packet corresponding to each data packet to the sender, and when the sender receives the acknowledgement packet ACK (4) of seq4(4), the sender triggers the retransmission of seq2(2) (the triggering method refers to the related description in fig. 5), the retransmitted data packet is seq2(8), and after the retransmission of the data packet seq2(8), the acknowledgement packet ACK 5(5), seq6(6) and seq7(7) is received, the ACK packet 2(5), seq 2(6) and the ARC 2(7), and the ACK is sent by the sequence number, even if the data packet is received repeatedly, even if three data packets are received, and then the acknowledgement packet 2 is a repeated, however, since the transmission sequence numbers of the received acknowledgement packets are consecutive, no data retransmission is triggered, so unnecessary retransmission is avoided, and thus, after the subsequent data packets Seq8(9), Seq9(10), and Seq10(11) are transmitted to the receiving end, the transmitting end can trigger fast retransmission of Seq2 according to the acknowledgement packets ACK2(9), ACK2(10), and ACK2(11) transmitted by the receiving end, thereby avoiding retransmission of the data packets only by way of retransmission overtime after the first fast retransmission data loss in the prior art, and improving the efficiency of data transmission.
Fig. 7 is a block diagram of a transmitting end according to an embodiment of the present invention. The sending end 70 includes a connection module 701, a sending module 702, a recording module 703, a confirmation module 704, and a retransmission module 705. The connection module 701 is configured to send a connection packet to the receiving end, where the connection packet includes first indication information indicating that a data packet sent by the receiving end includes the sending sequence number, so that when the receiving end determines that the received connection packet includes the indication information and a confirmation packet sent by the receiving end also includes the sending sequence number, a response packet is generated, where the response packet includes second indication information indicating that the confirmation packet sent by the receiving end includes the sending sequence number of the data packet corresponding to the confirmation packet; and the receiving end is further configured to receive a response packet sent by the receiving end, and if the response packet includes the second indication information, add the sending sequence number in subsequent sending of the data packet.
The sending module 702 is configured to send a data packet to a receiving end, where the sent data packet includes a data sequence number and a sending sequence number, the data sequence number represents a sequence of the sent data packet in the data stream, and the sending sequence number represents a sending sequence of the data packet, so that the receiving end generates an acknowledgement packet after receiving the data packet, obtains the sending sequence number of the data packet, adds the obtained sending sequence number to the acknowledgement packet, and sends the acknowledgement packet to the sending end, where a specific sending process may refer to steps S401 and S402 in fig. 4.
The recording module 703 is configured to record a mapping relationship between a data sequence number of the data packet and the transmission sequence number after the transmitting end transmits the data packet to the receiving end.
The confirmation module 704 is configured to receive a confirmation packet sent by the receiving end, and determine whether a retransmission data packet exists in a data packet sent before the data packet according to a sending sequence number in the confirmation packet, where the retransmission data packet is a data packet that needs to be retransmitted. When determining whether a retransmitted data packet exists in a data packet sent before the data packet, the acknowledgement module first determines whether first N acknowledgement packets of a currently received acknowledgement packet include a first discontinuous packet according to the transmission sequence number, where the transmission sequence number of the first discontinuous packet is discontinuous with the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet, and N is a retransmission threshold and is a natural number greater than 1; if yes, judging whether the difference value between the sending sequence number of the currently received confirmation packet and the sending sequence number of the first discontinuous packet is larger than or equal to the retransmission threshold value N; and if so, determining that the retransmitted data packet exists in the data packets transmitted before the data packet. Please specifically refer to the description of steps S404 to S408 in fig. 4.
The retransmission module 705 is configured to obtain the retransmitted data packet and transmit the retransmitted data packet to the receiving end, where a transmission sequence number of the retransmitted data packet is a transmission sequence of the retransmitted data packet. When acquiring the retransmitted data packet, the retransmission module 705 first determines a missing transmission sequence number between the transmission sequence number of the first discontinuous packet and the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet; acquiring a data sequence number of the retransmission data packet according to the determined missing sending sequence number and the mapping relation between the data sequence number of the data packet and the sending sequence number; and acquiring the retransmission data packet according to the data sequence number. Please refer to the description of steps S409 to S411 in fig. 4.
The data backup device and method provided by the embodiment of the present invention are described in detail above, and a specific example is applied in the description to explain the principle and the embodiment of the present invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (6)

1. A data transmission method is applied to a sending end, wherein the sending end transmits data stream to a receiving end, both the sending end and the receiving end support an OSseq mechanism, and the method comprises the following steps:
sending a data packet to a receiving end, wherein the sent data packet comprises a data sequence number and a sending sequence number, the data sequence number represents the sequence of the sent data packet in the data stream, and the sending sequence number represents the sending sequence of the data packet, so that the receiving end generates a confirmation packet after receiving the data packet, acquires the sending sequence number of the data packet, adds the acquired sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end;
receiving a confirmation packet sent by the receiving end; determining whether a retransmission data packet exists in data packets transmitted before the data packet according to the transmission sequence number in the confirmation packet, wherein the retransmission data packet is a data packet needing to be retransmitted; if yes, acquiring the retransmitted data packet and transmitting the retransmitted data packet to the receiving end, wherein the transmission sequence number of the retransmitted data packet represents the transmission sequence of the retransmitted data packet;
before sending the data packet to the receiving end, the method further comprises: sending a connection packet to the receiving end, where the connection packet includes first indication information indicating that a data packet sent by the receiving end includes the sending sequence number, so that when the receiving end determines that the received connection packet includes the indication information and a confirmation packet sent by the receiving end also includes the sending sequence number, a response packet is generated, the response packet includes second indication information indicating that the confirmation packet sent by the receiving end includes the sending sequence number of the data packet corresponding to the confirmation packet; and receiving a response packet sent by the receiving end, and if the response packet comprises the second indication information, adding the sending sequence number when the data packet is sent subsequently.
2. The data transmission method according to claim 1, wherein said determining whether there is a retransmission packet in the data packets transmitted before the data packet based on the transmission sequence number in the acknowledgement packet comprises:
judging whether the first N acknowledgement packets of the currently received acknowledgement packet include a first discontinuous packet or not according to the transmission sequence number, wherein the transmission sequence number of the first discontinuous packet is discontinuous with the transmission sequence number of the acknowledgement packet which is previous to the first discontinuous packet, and N is a retransmission threshold and is a natural number which is greater than 1;
if yes, judging whether the difference value between the sending sequence number of the currently received confirmation packet and the sending sequence number of the first discontinuous packet is larger than or equal to the retransmission threshold value N;
and if so, determining that the retransmitted data packet exists in the data packets transmitted before the data packet.
3. The data transmission method of claim 2, wherein the method further comprises:
after the data packet is sent to the receiving end, recording the mapping relation between the data sequence number of the data packet and the sending sequence number;
the obtaining the retransmitted data packet comprises:
determining a missing transmission sequence number between the transmission sequence number of the first discontinuous packet and the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet;
acquiring the data sequence number of the retransmission data packet according to the determined missing transmission sequence number and the mapping relation between the data sequence number of the data packet and the transmission sequence number;
and acquiring the retransmission data packet according to the data sequence number.
4. A sender, transmitting a data stream to a receiver, both of which support an OSSeq mechanism, the sender comprising:
a sending module, configured to send a data packet to a receiving end, where the sent data packet includes a data sequence number and a sending sequence number, the data sequence number indicates an order of the sent data packet in the data stream, and the sending sequence number indicates a sending order of the data packet, so that the receiving end generates a confirmation packet after receiving the data packet, obtains the sending sequence number of the data packet, adds the obtained sending sequence number to the confirmation packet, and sends the confirmation packet to the sending end;
the confirmation module is used for receiving a confirmation packet sent by the receiving end, and determining whether a retransmission data packet exists in a data packet sent before the data packet according to a sending sequence number in the confirmation packet, wherein the retransmission data packet is a data packet needing to be retransmitted;
a retransmission module, configured to acquire the retransmitted data packet and transmit the retransmitted data packet to the receiving end, where a transmission sequence number of the retransmitted data packet indicates a transmission sequence of the retransmitted data packet;
wherein, still include: the connection module is used for sending a connection packet to the receiving end, the connection packet comprises first indication information, the first indication information indicates that a data packet sent by the receiving end comprises the sending serial number, so that when the receiving end judges that the received connection packet comprises the indication information and a confirmation packet sent by the receiving end also comprises the sending serial number, a response packet is generated, the response packet comprises second indication information, and the second indication information indicates that the confirmation packet sent by the receiving end comprises the sending serial number of the data packet corresponding to the confirmation packet; and the receiving end is further configured to receive a response packet sent by the receiving end, and if the response packet includes the second indication information, add the sending sequence number in subsequent sending of the data packet.
5. The sender according to claim 4, wherein the confirmation module, when determining whether there is a retransmitted data packet in a data packet sent before the data packet according to the sending sequence number in the confirmation packet, is specifically configured to:
judging whether the first N acknowledgement packets of the currently received acknowledgement packet include a first discontinuous packet or not according to the transmission sequence number, wherein the transmission sequence number of the first discontinuous packet is discontinuous with the transmission sequence number of the acknowledgement packet which is previous to the first discontinuous packet, and N is a retransmission threshold and is a natural number which is greater than 1;
if yes, judging whether the difference value between the sending sequence number of the currently received confirmation packet and the sending sequence number of the first discontinuous packet is larger than or equal to the retransmission threshold value N;
and if so, determining that the retransmitted data packet exists in the data packets transmitted before the data packet.
6. The transmitting end of claim 5, further comprising:
the recording module is used for recording the mapping relation between the data sequence number of the data packet and the sending sequence number after the data packet is sent to the receiving end;
when acquiring the retransmitted data packet, the retransmission module is specifically configured to:
determining a missing transmission sequence number between the transmission sequence number of the first discontinuous packet and the transmission sequence number of a previous acknowledgement packet of the first discontinuous packet;
acquiring the data sequence number of the retransmission data packet according to the determined missing transmission sequence number and the mapping relation between the data sequence number of the data packet and the transmission sequence number;
and acquiring the retransmission data packet according to the data sequence number.
CN201611201236.7A 2016-12-22 2016-12-22 Data transmission method and sending end Active CN108234087B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611201236.7A CN108234087B (en) 2016-12-22 2016-12-22 Data transmission method and sending end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611201236.7A CN108234087B (en) 2016-12-22 2016-12-22 Data transmission method and sending end

Publications (2)

Publication Number Publication Date
CN108234087A CN108234087A (en) 2018-06-29
CN108234087B true CN108234087B (en) 2021-08-03

Family

ID=62657107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611201236.7A Active CN108234087B (en) 2016-12-22 2016-12-22 Data transmission method and sending end

Country Status (1)

Country Link
CN (1) CN108234087B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111385069A (en) * 2018-12-27 2020-07-07 广州市百果园信息技术有限公司 Data transmission method and computer equipment
CN111147197B (en) * 2019-12-30 2022-06-21 北京奇艺世纪科技有限公司 Data transmission method and system
CN111698510A (en) * 2020-05-22 2020-09-22 北京大米科技有限公司 Data processing method and device and electronic equipment
CN113286000A (en) * 2021-05-21 2021-08-20 国网河北省电力有限公司 Data receiving and transmitting method and device applied to power unidirectional transmission system
CN114257350A (en) * 2021-12-31 2022-03-29 广东省教育研究院 Transmission quality optimization method, device and transmission system
CN114443095A (en) * 2022-01-21 2022-05-06 佛山市钒音科技有限公司 Air conditioner upgrading method and air conditioner
CN116633911A (en) * 2022-02-08 2023-08-22 华为技术有限公司 Data processing method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101588225A (en) * 2009-06-25 2009-11-25 杭州再灵电子科技有限公司 Quick retransmission technique based on packet switching network
CN102664718A (en) * 2012-04-28 2012-09-12 大唐移动通信设备有限公司 Wireless side TCP (Transmission Control Protocol) data retransmission method and equipment
CN103503357A (en) * 2011-03-04 2014-01-08 黑莓有限公司 Controlling network device behavior

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9386127B2 (en) * 2011-09-28 2016-07-05 Open Text S.A. System and method for data transfer, including protocols for use in data transfer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101588225A (en) * 2009-06-25 2009-11-25 杭州再灵电子科技有限公司 Quick retransmission technique based on packet switching network
CN103503357A (en) * 2011-03-04 2014-01-08 黑莓有限公司 Controlling network device behavior
CN102664718A (en) * 2012-04-28 2012-09-12 大唐移动通信设备有限公司 Wireless side TCP (Transmission Control Protocol) data retransmission method and equipment

Also Published As

Publication number Publication date
CN108234087A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
CN108234087B (en) Data transmission method and sending end
US7502860B1 (en) Method and apparatus for client-side flow control in a transport protocol
CN112436994B (en) Data transmission method and electronic equipment
JP2002534907A (en) Communication device and communication method
KR20130082070A (en) Communication apparatus and communication method
JP2008508817A (en) High performance TCP suitable for low frequency ACK system
RU2460214C2 (en) Status message initiation in wireless communication system
CN112436924B (en) Data transmission method and electronic equipment
CN104104608B (en) Receive the method and device of message
WO2019128964A1 (en) Packet loss measurement method, apparatus, and system
CN111711680A (en) File breakpoint continuous transmission method and device based on UDP (user Datagram protocol)
CA2387913A1 (en) Transmitting data reliably and efficiently
CN108234089B (en) Method and system for low latency communication
CN116599953B (en) File uploading method, device, system, equipment and readable storage medium
CN117375776A (en) Data timeout retransmission method and acceleration unit
CN114390054A (en) Core network acceleration method, electronic equipment and computer storage medium
JP2000134279A (en) Flow control method
CN117040692A (en) Method and device for transmitting service data, electronic equipment and storage medium
KR20170126808A (en) User equipment and communication method of the same
CN116436570A (en) Data transmission method, device, equipment and computer readable storage medium
CN115866095A (en) Data transmission method and device, electronic equipment and storage medium
CN116963175A (en) Data transmission method, device and system
CN114598651A (en) Data transmission method and device
CN113424578B (en) Acceleration method and device for transmission control protocol
West et al. TCP enhancements for heterogeneous networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant