WO2016201904A1 - 一种基于tcp的数据传输方法及装置 - Google Patents

一种基于tcp的数据传输方法及装置 Download PDF

Info

Publication number
WO2016201904A1
WO2016201904A1 PCT/CN2015/095701 CN2015095701W WO2016201904A1 WO 2016201904 A1 WO2016201904 A1 WO 2016201904A1 CN 2015095701 W CN2015095701 W CN 2015095701W WO 2016201904 A1 WO2016201904 A1 WO 2016201904A1
Authority
WO
WIPO (PCT)
Prior art keywords
bytes
retransmission
receiving
total number
received
Prior art date
Application number
PCT/CN2015/095701
Other languages
English (en)
French (fr)
Inventor
胡安峰
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016201904A1 publication Critical patent/WO2016201904A1/zh

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/1607Details of the supervisory signal
    • 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

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data transmission method and apparatus based on TCP (Transmission Control Protocol).
  • TCP Transmission Control Protocol
  • TCP Transmission Control Protocol
  • data transmission based on TCP generally has a high packet loss rate, out-of-order rate, and delay jitter, which causes the TCP sender to receive multiple repeated ACKs from the receiver.
  • the transmitting end since the data packet does not completely reach the opposite end, the transmitting end also considers that the network state is congested at this time, thereby drastically reducing the congestion window and performing data retransmission at a smaller packet transmission rate.
  • the data packet arrives at the receiving end only due to the stability of the network transmission.
  • the network congestion does not occur, and the unnecessary reduction of the congestion window by the transmitting end unnecessarily reduces the data transmission speed and bandwidth utilization.
  • the TCP congestion window is often unnecessarily reduced, thereby reducing the problem of data transmission speed and bandwidth utilization, and there is no effective solution in the related art.
  • the embodiment of the invention provides a data transmission method and device based on TCP, which is used to at least solve the problem that the TCP congestion window in the related art is unnecessarily reduced, and the data transmission speed and bandwidth utilization are greatly reduced.
  • the embodiment of the present invention provides a TCP-based data transmission method, including: in a process of performing data retransmission to a receiving end device, the sending end device collects a total number of bytes of retransmitted packets; The sending end device acquires the total number of received bytes of the repeated message received by the receiving end device; after the data retransmission ends, if the total number of received bytes is greater than or equal to the total number of bytes sent, The sender device confirms that the network is not congested, and sends a packet by using the packet sending parameter before the data retransmission.
  • the sending end device collects the total number of bytes of the retransmitted message, where the sending end device performs data retransmission to the receiving end device. During the process, the number of bytes of all retransmitted messages is accumulated.
  • the receiving, by the sending end device, the total number of received bytes of the repeated message received by the receiving end device includes: receiving, by the sending end device, a receiving confirmation message of the receiving end device, the receiving acknowledgement message And carrying the start sequence number and the end sequence number of the repeated message received by the receiving end; the sending end device determines, according to the difference between the ending sequence number and the starting sequence number, that the receiving confirmation message corresponds to The number of bytes of the message; the sender device will receive each of the received The number of bytes of the message corresponding to the acknowledgement message is accumulated to obtain the total number of bytes received.
  • the packet sending parameter includes a congestion window and a slow start threshold.
  • the process of retransmitting the data includes: starting from a fast retransmission to ending the fast retransmission; or starting from a timeout retransmission to the end of the timeout retransmission.
  • the embodiment of the present invention further provides a TCP-based data transmission apparatus, including: a statistics unit, configured to collect the total bytes of retransmission messages during data retransmission to the receiving device.
  • the acquiring unit is configured to obtain the total number of received bytes of the repeated message received by the receiving device;
  • the acknowledgment and sending unit is set to be greater than or equal to the total number of bytes received after the data retransmission ends In the case of transmitting the total number of bytes, it is confirmed that the network is not congested, and the packet is transmitted using the packet transmission parameter before the data retransmission.
  • the statistic unit is specifically configured to accumulate the number of bytes of all retransmitted packets in a process of performing data retransmission to the receiving end device.
  • the acquiring unit includes: a receiving module, configured to receive a receiving acknowledgement message sent by the receiving end device, where the receiving acknowledgement message carries a start sequence number of the repeated packet received by the receiving end, and Ending a sequence number; determining a module, configured to determine, according to a difference between the end sequence number and the start sequence number, a number of bytes of the message corresponding to the receiving confirmation message; and an accumulation module configured to set the determining module The determined number of bytes of the message corresponding to each of the received acknowledgement messages is accumulated to obtain the total number of received bytes.
  • the packet sending parameter includes a congestion window and a slow start threshold.
  • the process of retransmitting the data includes: starting from a fast retransmission to ending the fast retransmission; or starting from a timeout retransmission to the end of the timeout retransmission.
  • the transmitting end device in the process of performing data retransmission to the receiving end device, can count the total number of bytes sent by the retransmitted packet, and obtain the receiving end. The total number of received bytes of the repeated packets received by the device. After the data retransmission is completed, all retransmitted packets are received when the total number of received bytes is greater than or equal to the total number of bytes sent. The terminal has received the packet, and the network is not congested. Therefore, the packet is sent using the packet before the data is retransmitted.
  • the transmitting device further determines whether network congestion has occurred and is used by comparing the total number of bytes sent and the total number of bytes received, thereby avoiding reporting.
  • the transmission parameters of the text are unnecessarily reduced, which effectively improves the data transmission speed and bandwidth utilization.
  • FIG. 1 is a flowchart of a TCP-based data transmission method according to an embodiment of the present invention
  • FIG. 2 is another flowchart of a TCP-based data transmission method according to an embodiment of the present invention.
  • FIG. 3 is still another flowchart of a TCP-based data transmission method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a TCP-based data transmission apparatus according to an embodiment of the present invention.
  • an embodiment of the present invention provides a data transmission method based on TCP, including:
  • the sender device collects the total number of bytes sent by the retransmission packet in the process of performing data retransmission to the receiving device.
  • the sending end device acquires a total number of received bytes of the repeated message received by the receiving end device.
  • the transmitting device confirms that the network is not congested, and sends a parameter transmission report by using a packet before data retransmission. Text.
  • the transmitting end device in the process of performing data retransmission to the receiving end device, can count the total number of bytes sent by the retransmission packet, and obtain the receiving end device receiving The total number of bytes received in the repeated message, after the data retransmission is completed, in the case that the total number of received bytes is greater than or equal to the total number of bytes sent, it indicates that all retransmitted message receiving ends are It has been received that the probability of receiving the packet indicates that the network is not congested, so the packet is sent using the packet before the data is retransmitted.
  • the transmitting device determines whether network congestion actually occurs by comparing the total number of bytes sent and the total number of bytes received, thereby avoiding packet transmission.
  • the parameters are unnecessarily reduced, effectively improving data transmission speed and bandwidth utilization.
  • the packet sending parameter is a parameter setting when the sending end device sends a packet, and may include a congestion window and a slow start threshold.
  • the congestion window is the maximum number of data packets that can be sent in an RTT (Round-Trip Time), which is determined by the sending device according to the congestion level of the network according to the sending end, and the slow start threshold indicates The inflection point of the rate at which the packet is sent by the sender device.
  • RTT Red-Trip Time
  • the initial TCP sends a large number of packets to the network after the connection is successfully established. This can easily lead to exhaustion of the router cache space in the network. Congestion.
  • the newly established connection cannot send a large number of data packets from the beginning, but can only gradually increase the amount of data sent each time according to the network condition to avoid congestion.
  • the sending end TCP sends parameters in a high-level packet, such as a congestion window and a slow-start threshold.
  • a high-level packet such as a congestion window and a slow-start threshold.
  • the transmitting device considers that network congestion occurs and transmits data with smaller packet transmission parameters.
  • network congestion does not really occur, so it may not be necessary to reduce the message transmission parameters.
  • the transmitting device may first record the packet sending parameters before data retransmission, and compare the data traffic sent and received during the data retransmission process.
  • the sending end device performs the data retransmission to the receiving end device, and the total number of bytes sent by the retransmitting packet may be: the transmitting end device performs data retransmission to the receiving end device.
  • the number of bytes of all retransmitted messages is accumulated.
  • the transmitting device needs to retransmit the data packet 3, the data packet 4, and the data packet 5 to the receiving end device, if the size of the data packet 3 is 1024 bytes, and the size of the data packet 4 is 4096. Byte, the size of the data packet 5 is 516 bytes.
  • the sender device collects the total number of bytes of retransmitted packets sent during a data retransmission process. For the total number of bytes of the repeated packets received by the receiving end, the sending device can obtain the received packet message fed back by the receiving device. Specifically, in step S12, the acquiring, by the source device, the total number of received bytes of the repeated message received by the receiving device may include:
  • the sending end device determines, according to the difference between the ending sequence number and the starting sequence number, the number of bytes of the packet corresponding to the receiving confirmation message;
  • the sending end device accumulates the number of bytes of the message corresponding to each of the receiving confirmation messages to obtain the total number of bytes received.
  • the TCP receiving end after receiving the packet, feeds back a receiving acknowledgement message, such as an ACK packet, to the sending device.
  • the transmitting device detects whether each incoming ACK message carries a D-SACK (Duplicate Selective Ackowledgement) option.
  • D-SACK is an extension standard of TCP SACK option proposed by RFC2883, which allows the first SACK block in TCP to carry the start sequence number and the end sequence number of repeated messages received by the receiving end. If the D-SACK option is carried in the ACK packet, the start sequence number and the end sequence number of the repeated message received by the receiving end carried in the D-SACK option are extracted, and the two are subtracted to obtain the received end.
  • the number of bytes of the message is repeated, and the number of repeated message bytes fed back by each ACK message is added to the byte number variable confirmed by the D-SACK. This process continues until the end of the data retransmission, so that the total number of bytes received by the receiving device is repeated.
  • the process of data retransmission may be from a fast retransmission to the end of the fast retransmission, that is, the transmitting device starts fast by continuously receiving a preset number of times (for example, 3 times).
  • the retransmission is transmitted, and the recovery state is terminated until the end of the fast retransmission, or from the timeout retransmission to the end of the retransmission, that is, from the retransmission timer of the transmitting device to the timeout retransmission state. , to the end of this timeout retransmission to exit the recovery state.
  • step S13 after the end of one data retransmission, the total number of bytes received can be compared with the total number of bytes sent. If the total number of bytes received is greater than or equal to the total number of bytes sent, this retransmission is described.
  • the receiving end of the packet has received at least 2 times. The network is in good condition and there is no congestion. It is not necessary to reduce the packet sending parameters according to the countermeasures of network congestion. Therefore, the packet sending parameters recorded before the data retransmission can be restored. Continue to send messages, effectively improving the data transmission speed and bandwidth utilization of the network.
  • TCP-based data transmission method provided by the present invention will be described in detail below through specific embodiments.
  • FIG 2 shows the processing flow of the TCP sender device to send packets.
  • Figure 3 shows the processing flow for the TCP sender device to receive packets.
  • the TCP sending device when the TCP sending device sends a packet, it mainly includes the following steps:
  • the sending end receives 3 repeated ACKs, initiates fast retransmission or enters a timeout retransmission state due to a retransmission timer timeout.
  • step 205 for each sent packet, check whether it is a retransmission message; if yes, go to step 206, if not step 207;
  • the TCP sending device when the TCP sending device receives the packet, it mainly includes the following steps:
  • the sending end device receives an ACK message fed back by the receiving end device.
  • step 303 Check if there is D-SACK information. If yes, go to step 303; otherwise, go to step 305.
  • step 303 checking whether the recorded congestion window and the slow start threshold are valid, if valid, performing step 304, otherwise performing step 305;
  • step 306 Determine whether the sending end has exited the recovery state after the fast retransmission or the timeout retransmission. If yes, go to step 306, if no, go to step 309;
  • the server may be larger than the case, indicating that the network is not congested, go to step 307, otherwise go to step 309;
  • an embodiment of the present invention further provides a TCP-based data transmission apparatus, including:
  • the statistic unit 41 is configured to count the total number of bytes sent by the retransmitted message in the process of performing data retransmission to the receiving end device;
  • the obtaining unit 42 is configured to obtain the total number of received bytes of the repeated message received by the receiving end device;
  • the acknowledgment and transmitting unit 43 is configured to, after the end of the data retransmission, confirm that the network is not congested, and the message transmission parameter before the continuation is used, if the total number of received bytes is greater than or equal to the total number of bytes to be transmitted. Message.
  • the statistics unit 41 can count the total number of bytes of the retransmitted message, and the obtaining unit 42 can obtain the receiving.
  • the total number of received bytes of the repeated message received by the end device, and the acknowledgment and transmitting unit 43 can confirm the total number of bytes received after the end of the data retransmission is greater than or equal to the total number of bytes sent.
  • the network is not congested, and the packet is sent using the packet before the data is retransmitted.
  • the transmitting device determines by comparing the total number of bytes sent and the total number of bytes received. Whether network congestion really occurs, whether it is necessary to resume the use of packet transmission parameters before data retransmission to send packets, thereby avoiding unnecessary reduction of packet transmission parameters, and effectively improving data transmission speed and bandwidth utilization.
  • the statistics unit 41 may be configured to accumulate the number of bytes of all retransmitted packets in the process of performing data retransmission to the receiving end device.
  • the obtaining unit 42 may specifically include:
  • a receiving module configured to receive a receiving confirmation message sent by the receiving end device, where the receiving confirmation message carries a starting sequence number and an ending sequence number of the repeated message received by the receiving end;
  • a determining module configured to determine, according to the difference between the ending sequence number and the starting sequence number, the number of bytes of the packet corresponding to the receiving confirmation message
  • the accumulating module is configured to accumulate the number of bytes of the message corresponding to each of the receiving confirmation messages determined by the determining module, to obtain the total number of bytes received.
  • the packet sending parameter includes a congestion window and a slow start threshold.
  • the process of retransmitting the data includes: starting from a fast retransmission to ending the fast retransmission; or starting from a timeout retransmission to the end of the timeout retransmission.
  • the transmitting end device can collect the retransmission packet transmission during the data retransmission to the receiving end device.
  • the total number of bytes, and the total number of bytes of the received repeated message received by the receiving device, after the data retransmission is completed, the total number of bytes received is greater than or equal to the total number of bytes sent. In this case, it indicates that all retransmitted packets have been received by the receiving end, and the network is not congested. Therefore, the packet is sent using the packet before the data is retransmitted.
  • the transmitting device further determines whether network congestion has occurred and is used by comparing the total number of bytes sent and the total number of bytes received, thereby avoiding reporting.
  • the text transmission parameters are unnecessarily reduced, effectively increasing the number According to transmission speed and bandwidth utilization.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Communication Control (AREA)

Abstract

本发明公开一种基于TCP的数据传输方法及装置,涉及通信技术领域,用以至少解决相关技术中TCP拥塞窗口不必要地减小,大大降低数据传输速度和带宽利用率的问题。所述方法包括:发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数;数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,发送端设备确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。

Description

一种基于TCP的数据传输方法及装置 技术领域
本发明涉及通讯技术领域,特别是涉及一种基于TCP(Transmission Control Protocol,传输控制协议)的数据传输方法及装置。
背景技术
在无线网络中,基于TCP(Transmission Control Protocol,传输控制协议)的数据传输一般存在较高丢包率、乱序率和延迟抖动,导致TCP发送端常常收到来自接收端的多次重复ACK而进行数据包的快速重传,或者由于重传定时器超时进行数据包的超时重传。不仅如此,由于数据包没有完全到达对端,发送端还会认为此时网络状态拥塞,因而剧烈降低拥塞窗口,而以较小的报文发送速率进行数据重传。
然而,大多数情况下,数据包只是由于网络传输稳定性的原因延迟到达接收端,并非真正发生了网络拥塞,发送端不必要地降低拥塞窗口会不必要地降低数据传输速度和带宽利用率。
针对TCP拥塞窗口常常不必要地减小,从而降低了数据传输速度和带宽利用率的问题,相关技术中并无有效的解决方案。
发明内容
本发明实施例提供了一种基于TCP的数据传输方法及装置,用以至少解决相关技术中TCP拥塞窗口不必要地减小,大大降低数据传输速度和带宽利用率的问题。
一方面,本发明实施例提供了一种基于TCP的数据传输方法,包括:发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数;数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,发送端设备确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。
可选的,所述发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数包括:所述发送端设备在向接收端设备进行数据重传的过程中,将所有重传报文的字节数进行累加。
可选的,所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数包括:所述发送端设备接收所述接收端设备的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;所述发送端设备根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;所述发送端设备将各所述接收 确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
可选的,所述报文发送参数包括拥塞窗口和慢启动门限。
可选的,所述数据重传的过程包括:从一次快速重传开始到所述快速重传结束;或者从一次超时重传开始到所述超时重传结束。
另一方面,本发明实施例还提供了一种基于TCP的数据传输装置,包括:统计单元,设置为在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;获取单元,设置为获取所述接收端设备接收到的重复报文的接收总字节数;确认和发送单元,设置为数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。
可选的,所述统计单元,具体设置为在向所述接收端设备进行数据重传的过程中,将所有重传报文的字节数进行累加。
可选的,所述获取单元包括:接收模块,设置为接收所述接收端设备发送的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;确定模块,设置为根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;累加模块,设置为将所述确定模块确定的各所述接收确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
可选的,所述报文发送参数包括拥塞窗口和慢启动门限。
可选的,所述数据重传的过程包括:从一次快速重传开始到所述快速重传结束;或者从一次超时重传开始到所述超时重传结束。
本发明实施例提供的基于TCP的数据传输方法和装置,发送端设备在向接收端设备进行数据重传的过程中,能够统计重传报文的发送总字节数,并获取所述接收端设备接收到的重复报文的接收总字节数,数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,说明所有重发的报文接收端都已经收到,网络并未拥塞,所以使用数据重传之前的报文发送参数发送报文。这样,在TCP数据传输过程中,即使发生了数据重传,发送端设备也会通过比较发送总字节数与接收总字节数进一步确定是否真的发生了网络拥塞并使用,从而避免了报文发送参数不必要地减小,有效提高了数据传输速度和带宽利用率。
附图说明
图1是本发明实施例提供的基于TCP的数据传输方法的一种流程图;
图2是本发明实施例提供的基于TCP的数据传输方法的另一种流程图;
图3是本发明实施例提供的基于TCP的数据传输方法的又一种流程图;
图4是本发明实施例提供的基于TCP的数据传输装置的一种结构示意图。
具体实施方式
以下结合附图对本发明进行详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不限定本发明。
如图1所示,本发明实施例提供一种基于TCP的数据传输方法,包括:
S11,发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;
S12,所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数;
S13,数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,发送端设备确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。
本发明实施例提供的基于TCP的数据传输方法,发送端设备在向接收端设备进行数据重传的过程中,能够统计重传报文的发送总字节数,并获取所述接收端设备接收到的重复报文的接收总字节数,数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,说明所有重发的报文接收端都已经收到,这种收包概率说明网络并未拥塞,所以使用数据重传之前的报文发送参数发送报文。这样,在TCP数据传输过程中,即使发生了数据重传,发送端设备也会通过比较发送总字节数与接收总字节数进一步确定是否真的发生了网络拥塞,从而避免了报文发送参数不必要地减小,有效提高了数据传输速度和带宽利用率。
可选的,报文发送参数为发送端设备进行报文发送时的一些参数设置,可以包括拥塞窗口和慢启动门限等。其中,拥塞窗口为在一个RTT((Round-Trip Time,往返时延)内可以最多发送的数据包数,是发送端设备根据发送端根据网络的拥塞程度预设的。而慢启动门限则表示发送端设备报文发送报文速率增长的一个拐点。具体来说,最初的TCP在连接建立成功后会向网络中发送大量的数据包,这样很容易导致网络中路由器缓存空间耗尽,从而发生拥塞。因此新建立的连接不能够一开始就大量发送数据包,而只能根据网络情况逐步增加每次发送的数据量,以避免拥塞现象的发生。发送端设备发送报文的速率增长的拐点即为慢启动门限。
一般的,网络状况良好的情况下,发送端TCP会以较高的报文发送参数,如拥塞窗口和慢启动门限等,进行报文发送。但当协议栈进入快速重传或超时重传时,发送端设备会认为发生了网络拥塞而以较小的报文发送参数进行数据重传。但很多情况下,并非真正发生了网络拥塞,因此降低报文发送参数很可能是没必要的。为了进一步鉴别是否真正发生了网络拥塞,发送端设备可以先记录下数据重传之前的报文发送参数,对数据重传过程中发送和接收的数据流量进行比较。
可选的,步骤S11中,发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数可包括:发送端设备在向接收端设备进行数据重传的过程中,将所有重传报文的字节数进行累加。例如,在本发明的一个实施例中,发送端设备需要向接收端设备重传数据包3、数据包4、数据包5,假如数据包3的大小为1024字节,数据包4大小为4096字节,数据包5大小为516字节,则本次数据重传过程中,重传报文的发送总字节数为 1024+4096+516=5636字节。
以上,发送端设备统计了在一次数据重传过程中,发送的重传报文的总字节数。而对于接收端收到的重复报文的总字节数,发送端设备可以通过接收端设备反馈的接收报文消息来获取。具体的,在步骤S12中,发送端设备获取所述接收端设备接收到的重复报文的接收总字节数可包括:
所述发送端设备接收所述接收端设备的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;
所述发送端设备根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;
所述发送端设备将各所述接收确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
举例说明,在本发明的一个实施例中,TCP接收端在收到报文后,会向发送端设备反馈接收确认消息,例如ACK报文。发送端设备对每个到来的ACK报文检测其中是否携带D-SACK(Duplicate Selective Ackowledgement,重复选择确认)选项。其中,D-SACK是RFC2883提出的一种对TCP的SACK选项的扩展标准,允许在TCP的第一个SACK块携带接收端收到的重复报文的起始序列号和结束序列号。如果检测到ACK报文中携带D-SACK选项,则提取D-SACK选项中携带的接收端收到的重复报文的起始序列号和结束序列号,二者相减得到接收端收到的重复报文的字节数,并将每次ACK报文反馈的重复报文字节数累加到D-SACK确认的字节数变量。这个过程持续到本次数据重传结束,从而得到接收端设备收到的重复报文的接收总字节数。
需要说明的是,所述数据重传的过程可以为从一次快速重传开始到所述快速重传结束,也就是发送端设备从连续接收到预设次数(例如3次)重复ACK而启动快送重传起,到本次快速重传结束退出recovery状态止;或者从一次超时重传开始到所述超时重传结束,也就是从发送端设备的重传定时器超时进入超时重传状态起,到本次超时重传结束退出recovery状态止。
在步骤S13中,在一次数据重传结束后,可以将接收总字节数与发送总字节数进行比较,如果接收总字节数大于或等于发送总字节数,说明本次的重传的报文接收端全部收到了至少2次,网络情况良好,并未发生拥塞,没有必要按照网络拥塞的应对措施调低报文发送参数,因此可以恢复使用数据重传之前记录的报文发送参数继续发送报文,有效提高了网络的数据传输速度和带宽利用率。
下面通过具体实施例对本发明提供的基于TCP的数据传输方法进行详细说明。
图2所示为TCP发送端设备发送报文的处理流程,图3所示为TCP发送端设备接收报文的处理流程。
如图2所示,TCP发送端设备进行报文发送时,主要包括如下步骤:
201、若发送端收到3次重复ACK,启动快送重传或者由于重传定时器超时而进入超时重传状态;
202、清零重传字节数累计变量和D-SACK确认字节数累计变量;
203、记录下当前的拥塞窗口和慢启动门限,同时将该记录值设置为合法;
204、减小拥塞窗口和慢启动门限,从发送队列选择报文发送;
205、对每一个发送的报文,检查是否为重传报文;如果是,执行步骤206,如果否执行步骤207;
206、累计重传报文的字节数;
207、执行TCP协议原有流程。
如图3所示,TCP发送端设备进行报文接收时,主要包括如下步骤:
301、发送端设备收到接收端设备反馈的ACK报文;
302、检查是否带有D-SACK信息。若有,执行步骤303;否则,进入步骤305。
303、检查记录的拥塞窗口和慢启动门限是否有效,若有效,执行步骤304,否则执行步骤305;
304、累加D-SACK确认的字节数,执行步骤305;
305、判断此刻发送端是否已经退出了快速重传或超时重传后的recovery状态。若是,执行步骤306,若否,执行步骤309;
306、比较D-SACK累加的字节数和重传报文累计的字节数,若D-SACK累加的字节数大于或等于重传报文累计的字节数(网络中存在多个代理服务器时可能会出现大于的情况),说明网络不拥塞,执行步骤307,否则执行步骤309;
307、将拥塞窗口和慢启动门限恢复成之前记录的值,修正这次不正确的降窗;
308、将重传字节数累计变量和D-SACK确认字节数累计变量清零,将记录拥塞窗口和慢启动门限合法标志设置为不合法,为下一次D-SACK修正拥塞窗口流程准备。
309、继续原有TCP输入处理流程。
相应的,如图4所示,本发明的实施例还提供一种基于TCP的数据传输装置,包括:
统计单元41,设置为在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;
获取单元42,设置为获取所述接收端设备接收到的重复报文的接收总字节数;
确认和发送单元43,设置为数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,确认网络未拥塞,继续使用之前的报文发送参数发送报文。
本发明实施例提供的基于TCP的数据传输装置,在向接收端设备进行数据重传的过程中,统计单元41能够统计重传报文的发送总字节数,获取单元42能够获取所述接收端设备接收到的重复报文的接收总字节数,确认和发送单元43能够在数据重传结束后,所述接收总字节数大于或等于所述发送总字节数的情况下,确认网络未拥塞,并使用数据重传之前的报文发送参数发送报文。这样,在TCP数据传输过程中,即使因为数据重传过程中使用了较低的报文发送参数进行数据重传,发送端设备也会通过比较发送总字节数与接收总字节数进一步确定是否真的发生了网络拥塞,是否需要恢复使用数据重传之前的报文发送参数进行报文发送,因而避免了报文发送参数不必要地减小,有效提高了数据传输速度和带宽利用率。
可选的,统计单元41,具体可设置为在向所述接收端设备进行数据重传的过程中,将所有重传报文的字节数进行累加。
可选的,获取单元42具体可包括:
接收模块,设置为接收所述接收端设备发送的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;
确定模块,设置为根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;
累加模块,设置为将所述确定模块确定的各所述接收确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
可选的,所述报文发送参数包括拥塞窗口和慢启动门限。
可选的,所述数据重传的过程包括:从一次快速重传开始到所述快速重传结束;或者从一次超时重传开始到所述超时重传结束。
尽管为示例目的,已经公开了本发明的优选实施例,本领域的技术人员将意识到各种改进、增加和取代也是可能的,因此,本发明的范围应当不限于上述实施例。
工业实用性
如上所述,本发明实施例提供的一种基于TCP的数据传输方法及装置,具有以下有益效果:发送端设备在向接收端设备进行数据重传的过程中,能够统计重传报文的发送总字节数,并获取所述接收端设备接收到的重复报文的接收总字节数,数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,说明所有重发的报文接收端都已经收到,网络并未拥塞,所以使用数据重传之前的报文发送参数发送报文。这样,在TCP数据传输过程中,即使发生了数据重传,发送端设备也会通过比较发送总字节数与接收总字节数进一步确定是否真的发生了网络拥塞并使用,从而避免了报文发送参数不必要地减小,有效提高了数 据传输速度和带宽利用率。

Claims (10)

  1. 一种基于TCP的数据传输方法,包括:
    发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;
    所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数;
    数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,所述发送端设备确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。
  2. 根据权利要求1所述的方法,其中,所述发送端设备在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数包括:
    所述发送端设备在向接收端设备进行数据重传的过程中,将所有重传报文的字节数进行累加。
  3. 根据权利要求1所述的方法,其中,所述发送端设备获取所述接收端设备接收到的重复报文的接收总字节数包括:
    所述发送端设备接收所述接收端设备的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;
    所述发送端设备根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;
    所述发送端设备将各所述接收确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
  4. 根据权利要求1至3中任一项所述的方法,其中,所述报文发送参数包括拥塞窗口和慢启动门限。
  5. 根据权利要求1至3中任一项所述的方法,其中,所述数据重传的过程包括:
    从一次快速重传开始到所述快速重传结束;或者
    从一次超时重传开始到所述超时重传结束。
  6. 一种基于TCP的数据传输装置,包括:
    统计单元,设置为在向接收端设备进行数据重传的过程中,统计重传报文的发送总字节数;
    获取单元,设置为获取所述接收端设备接收到的重复报文的接收总字节数;
    确认和发送单元,设置为数据重传结束后,在所述接收总字节数大于或等于所述发送总字节数的情况下,确认网络未拥塞,使用数据重传之前的报文发送参数发送报文。
  7. 根据权利要求6所述的装置,其中,所述统计单元,具体设置为在向所述接收端设备进行 数据重传的过程中,将所有重传报文的字节数进行累加。
  8. 根据权利要求6所述的装置,其中,所述获取单元包括:
    接收模块,设置为接收所述接收端设备发送的接收确认消息,所述接收确认消息中携带所述接收端收到的重复报文的起始序列号和结束序列号;
    确定模块,设置为根据所述结束序列号与所述起始序列号之差,确定所述接收确认消息对应的报文的字节数;
    累加模块,设置为将所述确定模块确定的各所述接收确认消息对应的报文的字节数相累加,以获取所述接收总字节数。
  9. 根据权利要求6至8中任一项所述的装置,其中,所述报文发送参数包括拥塞窗口和慢启动门限。
  10. 根据权利要求6至8中任一项所述的装置,其中,所述数据重传的过程包括:
    从一次快速重传开始到所述快速重传结束;或者
    从一次超时重传开始到所述超时重传结束。
PCT/CN2015/095701 2015-06-16 2015-11-26 一种基于tcp的数据传输方法及装置 WO2016201904A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510333529.X 2015-06-16
CN201510333529.XA CN106330406A (zh) 2015-06-16 2015-06-16 一种基于tcp的数据传输方法及装置

Publications (1)

Publication Number Publication Date
WO2016201904A1 true WO2016201904A1 (zh) 2016-12-22

Family

ID=57544799

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/095701 WO2016201904A1 (zh) 2015-06-16 2015-11-26 一种基于tcp的数据传输方法及装置

Country Status (2)

Country Link
CN (1) CN106330406A (zh)
WO (1) WO2016201904A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018121294A1 (zh) * 2016-12-30 2018-07-05 华为技术有限公司 一种报文传输方法、终端、网络设备及通信系统
CN110213167A (zh) * 2018-02-28 2019-09-06 吴瑞 一种传输控制协议在网络拥塞时的处理方法和装置
CN112615760A (zh) * 2020-12-18 2021-04-06 京信网络系统股份有限公司 数据传输方法、装置、基站和存储介质
EP4054242A1 (en) * 2021-03-03 2022-09-07 Beijing Xiaomi Mobile Software Co., Ltd. Method, apparatus and storage medium for controlling network connection
CN115378888A (zh) * 2022-08-17 2022-11-22 深圳星云智联科技有限公司 一种数据处理方法、装置、设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147197B (zh) * 2019-12-30 2022-06-21 北京奇艺世纪科技有限公司 一种数据传输方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101112063A (zh) * 2004-11-29 2008-01-23 唐鲍勃 能够支持保证实际无拥塞服务的网络的即刻可用实施方案:外部因特网NextGenTCP(方波形式)TCP友好SAN
CN101141393A (zh) * 2006-09-08 2008-03-12 株式会社Ntt都科摩 通信终端、通信控制方法及通信控制程序
US20090094353A1 (en) * 2007-10-05 2009-04-09 Hitachi, Ltd Information processing apparatus and information processing system
CN103685489A (zh) * 2013-12-02 2014-03-26 许继电气股份有限公司 无线网络中文件传输方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101112063A (zh) * 2004-11-29 2008-01-23 唐鲍勃 能够支持保证实际无拥塞服务的网络的即刻可用实施方案:外部因特网NextGenTCP(方波形式)TCP友好SAN
CN101141393A (zh) * 2006-09-08 2008-03-12 株式会社Ntt都科摩 通信终端、通信控制方法及通信控制程序
US20090094353A1 (en) * 2007-10-05 2009-04-09 Hitachi, Ltd Information processing apparatus and information processing system
CN103685489A (zh) * 2013-12-02 2014-03-26 许继电气股份有限公司 无线网络中文件传输方法

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018121294A1 (zh) * 2016-12-30 2018-07-05 华为技术有限公司 一种报文传输方法、终端、网络设备及通信系统
CN108270682A (zh) * 2016-12-30 2018-07-10 华为技术有限公司 一种报文传输方法、终端、网络设备及通信系统
US10924421B2 (en) 2016-12-30 2021-02-16 Huawei Technologies Co., Ltd. Packet transmission method, terminal, network device, and communications system
CN108270682B (zh) * 2016-12-30 2022-06-24 华为技术有限公司 一种报文传输方法、终端、网络设备及通信系统
CN110213167A (zh) * 2018-02-28 2019-09-06 吴瑞 一种传输控制协议在网络拥塞时的处理方法和装置
CN112615760A (zh) * 2020-12-18 2021-04-06 京信网络系统股份有限公司 数据传输方法、装置、基站和存储介质
EP4054242A1 (en) * 2021-03-03 2022-09-07 Beijing Xiaomi Mobile Software Co., Ltd. Method, apparatus and storage medium for controlling network connection
US11627489B2 (en) 2021-03-03 2023-04-11 Beijing Xiaomi Mobile Software Co., Ltd. Method, apparatus and storage medium for controlling network connection
CN115378888A (zh) * 2022-08-17 2022-11-22 深圳星云智联科技有限公司 一种数据处理方法、装置、设备及存储介质
CN115378888B (zh) * 2022-08-17 2023-08-08 深圳星云智联科技有限公司 一种数据处理方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106330406A (zh) 2017-01-11

Similar Documents

Publication Publication Date Title
WO2016201904A1 (zh) 一种基于tcp的数据传输方法及装置
CN107204834B (zh) 一种基于udt协议的高速网络可靠传输的控制方法
KR100787294B1 (ko) 이동 통신 기지국의 티씨피 성능 향상 장치
CN102006283B (zh) 数据传输的方法和装置
EP1568180B1 (en) A method for enhancing transmission quality of streaming media
CN104093170B (zh) 基于tcp的数据传输方法和tcp代理装置
US8085669B2 (en) Session relay device and session relay method
US20040052234A1 (en) Method and system for dispatching multiple TCP packets from communication systems
KR101470637B1 (ko) 이동통신 시스템에서의 무선자원 향상 방법, 상태정보 보고방법 및 수신장치
WO2013159516A1 (zh) 无线侧tcp数据重传的方法和设备
KR100547749B1 (ko) 재전송 타임아웃 수를 줄이기 위한 전송 제어 프로토콜의혼잡제어 방법과 시스템
US9456377B2 (en) System and method for transmission control protocol service delivery in wireless communications systems
US20160323062A1 (en) Packet recovery in interactive real-time media protocol
JPWO2008044653A1 (ja) 通信システム、通信装置、通信方法
CN111193577B (zh) 使用传输超时的网络系统通信方法及通信装置
US20070280107A1 (en) Data Unit Sender Control Method
KR100912178B1 (ko) 무선 환경에서의 혼잡제어방법 및 기록매체
CN102769520A (zh) 基于sctp协议的无线网络拥塞控制方法
WO2011012005A1 (zh) 一种无线链路控制层触发状态报告的方法及接收侧装置
US11503500B2 (en) Method and a user equipment (UE) for transport layer optimization using a preemptive cross layer signaling
JP7067544B2 (ja) 通信システム、通信装置、方法およびプログラム
US9510242B2 (en) Reducing superfluous traffic in a network
WO2014117359A1 (zh) 反馈丢包的消息处理方法及装置
CN104796235A (zh) 基于丢包率的卫星通信自适应拥塞控制方法
WO2004112305A1 (fr) Procede et appareil permettant d'ecarter des unites de donnees de services dans un mode accuse de reception d'une rlc dans un systeme de communication sans fil

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15895471

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15895471

Country of ref document: EP

Kind code of ref document: A1