Method and apparatus for improving TCP speed performance

By recording the five-tuple information of TCP data packets and ACK packets between the gateway and the downstream device, the type of packet loss can be determined and a replacement packet can be constructed. This solves the problem of wireless terminals being easily affected by the environment, and improves the accuracy of speed measurement and user experience.

CN116405414BActive Publication Date: 2026-01-09FIBERHOME TELECOMMUNICATION TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310340482.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-31
Publication Date
2026-01-09
Estimated Expiration
2043-03-31

AI Technical Summary

Technical Problem

During TCP speed testing of broadband terminals, wireless terminals are susceptible to environmental factors, leading to packet loss and data processing delays, which affect the accuracy of speed testing and user experience.

Method used

By recording the header 5-tuples of TCP data packets and ACK packets between the gateway and downstream devices, the type of packet loss can be determined, and a replacement packet can be constructed and resent to reduce the environmental impact.

Benefits of technology

It improves the accuracy of speed tests and user experience, reduces the impact of environmental factors on speed test results, and ensures that the speed test results are closer to the actual bandwidth.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116405414B_ABST
    Figure CN116405414B_ABST
Patent Text Reader

Abstract

The present application relates to the field of broadband terminal, in particular to a method and device for improving TCP speed measurement performance, which mainly comprises: saving the header quintuple of each TCP data packet and returned ACK packet between the gateway and the hanging device, recording the packet sequence number of each TCP data packet and the acknowledgement number carried by the TCP data packet, judging whether the TCP data packet is lost according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; obtaining the lost packet according to the recorded packet sequence number and the returned ACK packet, obtaining the corresponding lost packet type, constructing the corresponding supplement packet of the lost packet according to the saved header quintuple, and forwarding the supplement packet according to the lost packet type. The present application can control the number of lost packets in the data interaction process, and avoid the inaccurate speed measurement caused by the environmental influence between the gateway and the hanging device.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of broadband terminal, in particular to a method and device for improving TCP speed test performance. BACKGROUND

[0002] In the current use of broadband terminal, the operator customers and consumer customers pay more and more attention to the speed test performance, but in the whole transmission path, the forwarding path of the speed test data involves the whole network infrastructure, especially in the current network installation process of the operator terminal user, and when the consumer uses the speed test website to verify the bandwidth, the speed test terminal under the broadband terminal product, especially the terminal through wireless access, is easily affected by uncertain air interface environment and other aspects, the generated packet loss and data processing delay in the process of TCP speed test will affect the TCP interaction, and further affect the test rate, and further affect the final consumer's speed test experience.

[0003] The existing speed test process is generally through the HTTP protocol as the application layer message interaction, and is carried on the TCP protocol in the transmission layer, if downloading, the gateway receives the TCP data message and replies ACK, the speed test algorithm samples the rate in the speed test process, so as to obtain the speed test curve and the final speed test result, in the process of TCP speed test, the wired terminal under the broadband terminal is less affected by environmental factors, but the wireless terminal under the broadband terminal is easily affected by the air interface environment and the influence of wireless driving on message processing, which is specifically reflected in the speed test download process, the loss of TCP downlink message data is generated, and in the speed test upload process, the loss of TCP uplink message data or data processing delay is generated, which affects the TCP interaction, triggers the TCP congestion mechanism and window change, and causes the speed test throughput carried on the TCP to be low, so as to reduce the sampling rate.

[0004] Therefore, how to overcome the defects of the prior art and solve the phenomenon that the wireless terminal under the speed test process is easily affected by the environment is a problem to be solved in the technical field. SUMMARY

[0005] In view of the above defects or improvement needs of the prior art, the present application solves the problem that the wireless terminal under the speed test process is easily affected by the environment.

[0006] The embodiment of the present application adopts the following technical scheme:

[0007] In a first aspect, the present application provides a method for improving TCP speed testing performance, which specifically comprises: 1. A method for improving TCP speed testing performance, characterized in that it specifically comprises: saving the header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device, recording the packet sequence number of each TCP data packet and the acknowledgement number carried thereby, judging whether the TCP data packet is lost according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; obtaining the lost packet according to the recorded packet sequence number and the returned ACK packet, and obtaining the corresponding lost packet type, constructing the corresponding supplement packet of the lost packet according to the saved header quintuple, and forwarding the supplement packet according to the lost packet type.

[0008] Preferably, the saving of the header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device, and the recording of the packet sequence number of each TCP data packet and the acknowledgement number carried thereby specifically comprises: in the downlink speed testing, the gateway saves the header quintuple of each TCP data packet sent by the speed testing server to the hanging device, and records the packet sequence number of each TCP data packet and the acknowledgement number carried thereby; in the uplink speed testing, the gateway saves the header quintuple of each TCP data packet sent by the hanging device to the speed testing server, and records the packet sequence number of each TCP data packet and the acknowledgement number carried thereby.

[0009] Preferably, the saving of the header quintuple of each TCP data packet between the gateway and the hanging device, and the recording of the packet sequence number of each TCP data packet and the acknowledgement number carried thereby further comprises: the buffer size for storing the TCP data packet quintuple is: retransmission timeout time * maximum window value of the receiving end * packet header length; the buffer size for storing the ACK header quintuple is: retransmission timeout time * maximum window value of the sending end * packet header length.

[0010] Preferably, the judging of whether the TCP data packet is lost according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet, and the obtaining of the corresponding lost packet type specifically comprises: the gateway obtains the expected packet sequence number of the next TCP data packet according to the recorded packet sequence number; in the uplink speed testing, when the packet sequence number of the next TCP data packet sent by the hanging device to the speed testing server is greater than the expected packet sequence number, the missing sequence number between the expected packet sequence number and the packet sequence number of the next TCP data packet is taken as the sequence number of the lost packet, and the lost packet type is packet loss; in the downlink speed testing, when the corresponding TCP data packet packet sequence number carried in the ACK packet returned by the hanging device to the speed testing server is less than the expected packet sequence number, the missing sequence number between the corresponding TCP data packet packet sequence number carried and the expected packet sequence number is taken as the sequence number of the lost packet, and the lost packet type is packet loss.

[0011] Preferably, the method further comprises: recording the sequence number of the lost packet in a lost packet list, and judging whether the sequence number of the next TCP data packet received by the gateway is smaller than the expected packet sequence number, and if so, judging whether the sequence number exists in the lost packet list, and if so, the lost packet type is packet disordering.

[0012] Preferably, the method further comprises: obtaining the saved header quintuple according to the sequence number of the lost packet, taking the saved header quintuple as the header quintuple of the supplement packet, randomly generating the data payload of the supplement packet, and combining the header quintuple and the data payload of the supplement packet into the supplement packet.

[0013] Preferably, the method further comprises: when the lost packet type is packet loss, forwarding the corresponding supplement packet and updating the expected packet sequence number; when the lost packet type is packet disordering, forwarding the corresponding TCP data packet without updating the expected packet sequence number; and removing the corresponding sequence number in the lost packet list after forwarding the supplement packet or the TCP data packet.

[0014] Preferably, when the lost packet type is packet loss, the method further comprises: waiting for a specified unit time period, and if the supplement packet corresponding to the sequence number of the lost packet is not received within the specified unit time period, forwarding the corresponding supplement packet.

[0015] Preferably, the method further comprises: counting the ACK packets within a unit time, and forwarding the aggregated ACK packets.

[0016] In another aspect, the application provides a device for improving TCP speed measurement performance, which comprises at least one processor and a memory, the at least one processor and the memory are connected through a data bus, the memory stores instructions executable by the at least one processor, and the instructions are used to complete the method for improving TCP speed measurement performance in the first aspect after being executed by the processor.

[0017] Compared with the prior art, the embodiment of the application has the beneficial effects that: the lost packet between the gateway and the lower-hung device is actively supplemented by the gateway, the ACK packets forwarded by the gateway are aggregated, the number of lost packets in the data interaction process is controlled, and the inaccuracy of speed measurement caused by the environmental influence between the gateway and the lower-hung device is avoided, thereby improving the user experience. BRIEF DESCRIPTION OF DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments of the present application. Obviously, the drawings described below are only some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0019] Figure 1 A method flow chart for improving TCP speed measurement performance provided by the embodiment of the present application;

[0020] Figure 2 Another method flow chart for improving TCP speed measurement performance provided by the embodiment of the present application;

[0021] Figure 3 A downlink speed measurement scene schematic diagram of the embodiment of the present application;

[0022] Figure 4 An uplink speed measurement scene schematic diagram of the embodiment of the present application;

[0023] Figure 5 An ACK packet aggregation schematic diagram of the embodiment of the present application;

[0024] Figure 6 A device use scene schematic diagram of the apparatus for improving TCP speed measurement performance provided by the embodiment of the present application;

[0025] Figure 7 A device structure schematic diagram of the apparatus for improving TCP speed measurement performance provided by the embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the purpose, technical solutions and advantages of the present application more clear, the following will further describe the present application in combination with the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.

[0027] The present application is a system architecture of a specific function system, therefore in the specific embodiments, the function logical relationship of each structure module is mainly described, and the specific software and hardware implementation is not limited.

[0028] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as there is no conflict. The present application will be described in detail below in combination with the drawings and embodiments.

[0029] Embodiment 1:

[0030] The existing home gateway will cause packet loss due to environmental factors on the entire speed test link in the TCP-based speed test process, especially in the interaction process between the wireless terminal and the home gateway. The delay caused by data processing will cause the data measured by the user during the speed test to be lower than the bandwidth provided by the operator, so that the user cannot determine whether the failure to reach the promised bandwidth is due to insufficient bandwidth provided by the operator or the influence of the home internal network when using the speed test method of a mobile phone app and the like.

[0031] In the embodiment, a method for improving the speed test performance by supplementing the lost packets between the hanging device and the forwarding gateway during the download process is provided by the rules learned from the first packet (the first 20-30 packets) during the speed test process. The packets that can be supplemented include: the downlink TCP data packet (TCP session) sent by the server to the hanging device and the uplink TCP data packet sent by the hanging device to the server. The above-mentioned packets need to be forwarded through the gateway, but the connection between the server and the gateway is usually wired, and packet loss rarely occurs, so the bandwidth provided by the operator can be truly reflected. Therefore, the method provided in the embodiment does not process the packets between the server and the gateway, but only supplements the TCP data packets between the gateway and the hanging device, compensates for the speed test deviation caused by the environment between the internal gateway and the wireless hanging device in the home network, and does not improve the real bandwidth provided by the operator, nor breaks through the limit of the physical bandwidth. The operations in the embodiment are all performed on the gateway.

[0032] As shown in Figure 1 The specific steps of the method for improving the TCP speed test performance provided in the embodiment of the application are as follows:

[0033] Step 101: Save the five-tuple of the header of each TCP data packet and the returned ACK packet between the gateway and the hanging device, and record the packet sequence number of each TCP data packet and the carried acknowledgement number. Whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet.

[0034] According to the TCP protocol, the TCP data packet for transmitting data contains a packet sequence number (Sequence Number, abbreviated as seq) and an acknowledgement number (ACKnowledge Number, abbreviated as ACK). The packet sequence number represents the sequence number of the TCP data packet itself in the transmission queue of all data packets, which can be obtained by the seq field value in the TCP data packet. The acknowledgement number represents the ACK sequence number of the ACK packet corresponding to the TCP data packet. In the normal transmission process, the packet sequence number of each TCP data packet is sequentially incremented by +1 according to the sending order. The ACK sequence number in the returned ACK packet is the same as the acknowledgement number of the corresponding TCP data packet. The sequence number of the next packet requested in the returned ACK packet is the packet sequence number of the corresponding TCP data packet +1. In the method provided in the embodiment, the gateway as a forwarding device can record the packet sequence number, the acknowledgement number, and the ACK number in the returned ACK packet between the gateway and the hanging device. If the packet sequence number appears to be spaced apart, or the ACK number is inconsistent with the acknowledgement number, it indicates that TCP data packet loss may occur.

[0035] When performing speed measurement, only the number of transmitted and received data packets needs to be counted and calculated, and the specific data load content in the data packet does not need to be concerned. In order to improve the processing speed and avoid the influence of the method provided in the embodiment on the transmission speed of the data packet, the gateway does not indiscriminately identify each TCP data packet for forwarding, but only identifies and learns the five-tuple of the TCP data packet. Specifically, by configuration or automatic identification and learning, the five-tuple information in each TCP data packet is obtained: (1) source IP, (2) destination IP, (3) source port, (4) destination port, and (5) IP header. The five-tuple information can be used to construct the corresponding packet packet for retransmission. Further, in the uplink speed measurement, the gateway cannot receive the lost packet, so it cannot directly obtain the five-tuple of the lost packet from the lost packet, but can obtain the data corresponding to each item in the five-tuple according to other information in the TCP session to construct the corresponding five-tuple of the header.

[0036] Step 102: According to the recorded packet sequence number and the returned ACK packet, the lost packet is obtained, and the corresponding lost packet type is obtained. The lost packet corresponding to the lost packet is constructed according to the saved header five-tuple, and the lost packet is retransmitted according to the lost packet type.

[0037] After obtaining the lost packet, the lost packet can be constructed according to the recorded five-tuple information to perform retransmission, the bandwidth between the gateway and the hanging device is compensated to be consistent with the bandwidth between the gateway and the server, the influence of the air interface environment or the wireless driver on the speed measurement accuracy is avoided, and the speed measurement efficiency is reduced due to the retransmission of the packet between the gateway and the server.

[0038] For TCP data packets, the packet sequence numbers in the TCP data packets are counted in a specified unit of time, and the missing packets are supplemented. In a specific implementation, in order to ensure that the missing packet and the supplemented packet are consistent at the protocol layer, the supplemented packet is constructed according to the five-tuple of the header of the missing packet. Specifically, the five-tuple of the header of the supplemented packet is consistent with the five-tuple of the header of the missing packet, and the data payload of the supplemented packet is randomly generated. The supplemented packet and the missing packet are consistent at the protocol layer, and can be regarded as not missing from the perspective of the receiving device of the packet, so that the effect of not missing can be simulated without retransmission, and the speed measurement performance is improved.

[0039] After the steps 101-102 provided in this embodiment, the TCP data packet loss between the gateway and the hanging device during the download speed measurement and the uplink speed measurement is processed, so that the speed measurement performance is improved due to the poor network environment between the gateway and the hanging device, and the accuracy of the speed measurement is improved.

[0040] During uploading and downloading, the gateway is a central forwarding device between the hanging device and the server, and in order to obtain the missing packet and perform the corresponding retransmission operation, the five-tuple of each TCP data packet needs to be recorded. During the downlink speed measurement, the gateway saves the five-tuple of the header of each TCP data packet sent by the speed measurement server to the hanging device, and records the packet sequence number and the ACK sequence number carried by each TCP data packet; during the uplink speed measurement, the gateway saves the five-tuple of the header of each TCP data packet sent by the hanging device to the speed measurement server, and records the packet sequence number and the ACK sequence number carried by each TCP data packet.

[0041] The retransmission operation is based on the packet header length L hdr and the maximum transmission unit value L mtu of the current interaction to combine the packet content. The packet header length L hdr includes the five-tuple length of the packet, the packet sequence number, and the length of the acknowledgement number.

[0042] During the download speed measurement process, the TCP interaction information to be obtained is as follows. During the uplink speed measurement, the corresponding TCP interaction information also needs to be obtained.

[0043] (1) Link round trip time T1: In the three-way handshake process at the beginning of the TCP data packet, the transmission round trip time (RTT) T1 from the current link server to the gateway can be obtained through the acknowledgement packet of the SYN packet, and the RTT T2 from the gateway to the hanging device.

[0044] (2) From the packet interaction, the maximum window value swnd of the sending end is obtained, and the value is dynamically adjusted in the interaction, recorded as V swnd .

[0045] (3) From the packet interaction, the maximum window value rwnd of the receiving end is obtained, and the value is dynamically adjusted in the interaction, recorded as V rwnd .

[0046] (4) From the packet interaction, the MTU value of the current interaction is obtained, recorded as L mtu , and the packet header length value L hdr is obtained.

[0047] (5) The retransmission timeout T to is obtained from the current system. Specifically, some TCP properties of the gateway device can be obtained through the proc file system of the Linux system, including the retransmission timeout T to .

[0048] In order to save the header quintuple of each TCP data packet forwarded by the gateway, a packet forwarding buffer needs to be set on the gateway. In the embodiment, in order to avoid excessive occupation of the storage resources on the gateway, the required buffer size can be calculated according to the number of TCP data packets to be stored: (1) the buffer size for storing the header quintuple of the TCP data packet is: retransmission timeout time * maximum window value of receiving end * packet header length; (2) the buffer size for storing the ACK header quintuple is: retransmission timeout time * maximum window value of sending end * packet header length.

[0049] Specifically, taking the following downlink speed measurement as an example, the buffer size can be calculated in the following way, for the retransmission timeout T to , the maximum cache space V ram1 for the TCP data packet is applied, which will be used for storing the related header information L hdr of the TCP data packet. In order to reduce the cache occupation, the payload part of the packet is not stored, only the quintuple data is stored, so as to quickly construct the supplement packet using the quintuple data. As a downlink TCP data packet, the attention in the speed measurement process is the supplement packet for the terminal below, so the header cache for the downlink TCP data packet does not have to be greater than the window value V rwnd of the terminal below as the receiving end, and the memory size of the buffer area application is: V ram1 = T to * V rwnd * L hdr .

[0050] In this way, the size of the cache area that needs to be reserved on the gateway during the downlink speed test can be calculated. For the uplink speed test, the corresponding calculation can be completed by referring to the above method.

[0051] In order to perform the packet supplement, it is necessary to first determine whether there is a lost packet and obtain the packet sequence number and five-tuple information of the lost packet. In the method provided in this embodiment, whether the TCP data packet is lost is determined according to the recorded packet sequence number, the ACK sequence number carried and the returned ACK packet, and the corresponding lost packet type is obtained. As shown in Figure 2 , the method specifically comprises.

[0052] Step 201: The gateway obtains the expected packet sequence number of the next TCP data packet according to the recorded packet sequence number.

[0053] When the TCP data packet arrives at the gateway, the gateway records the seq field in the received TCP data packet. In the case where there is no lost packet, the value of the seq field is increased by the corresponding transmission byte number, and the expected packet sequence number of the next TCP data packet can be determined as the sequence number of the current packet + 1. For example, Figure 3 In the downlink speed test scenario shown in , the packet sequence number is represented by Data1, Data2, Data3, … When the gateway receives the packet Data1, the packet sequence number of the current packet is 1, and the expected packet sequence number of the next downlink TCP data packet can be determined as 2. Similarly, Figure 4 In the uplink speed test scenario shown in , when the gateway receives the packet Data1, the packet sequence number of the current packet is 1, and the expected packet sequence number of the next uplink TCP data packet can be determined as 2.

[0054] When the gateway receives the next TCP data packet, the value of the seq field of the packet is obtained. If the value of the seq field is equal to the expected packet sequence number, it indicates that there is no lost packet between the previous TCP data packet and the next TCP data packet. At this time, the expected packet sequence number is updated according to the value of the seq field of the next TCP data packet, and the next next TCP data packet is continued to be waited for. For example, after the gateway receives the packet Data1, the expected packet sequence number is 2, at this time, if the gateway receives the packet DATA2, it indicates that there is no lost packet between the Data1 and the Data2, and the expected packet sequence number is changed to 3 according to the seq value of the Data2.

[0055] Step 202: In the uplink speed test, when the packet sequence number of the next TCP data packet sent by the downlink device to the speed test server is greater than the expected packet sequence number, the missing packet sequence number between the expected packet sequence number and the packet sequence number of the next TCP data packet is taken as the sequence number of the lost packet, and the lost packet type is packet loss.

[0056] In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example, Figure 3 In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example,

[0057] In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example,

[0058] In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example,

[0059] In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example, Figure 3 In the uplink speed test, the lower hanging device is the sending end, and the gateway can receive each TCP data packet without loss. Therefore, the gateway can directly determine whether the packet is lost by the seq field value of the TCP data packet. When the packet is lost, the seq field value of the next received packet is greater than the expected packet sequence number in the order, and the missing sequence number between the expected packet sequence number and the seq field value of the next TCP data packet is the packet sequence number of the lost packet. For example,

[0060] After the steps 101-102 provided in the embodiment, the packet sequence number of the lost TCP data packet can be obtained, and the packet can be supplemented according to the five-tuple information corresponding to the packet sequence number.

[0061] Further, in the process of packet transmission, in addition to the packet loss, packet disorder may also occur due to transmission delay or active packet supplement of the sending end. When the packet is lost or disordered, the server may retransmit, and the retransmitted packet does not need to be supplemented. In order to avoid the repetition of the supplemented packet and the retransmitted packet, the packet supplement operation is not immediately performed on the lost packet, but a unit time period timer is set, and the specified unit time period is waited according to the timing of the timer. If the retransmitted packet corresponding to the sequence number of the lost packet is not received within the specified unit time period, the corresponding supplemented packet is forwarded. In the specific implementation, the unit time period can be set to 3 times the RTT value, that is, 3*T1. During the waiting period, the sequence number of the lost packet is recorded in the lost packet list. When the next TCP data packet received by the gateway has a packet sequence number less than the expected packet sequence number, it is judged whether the sequence number exists in the lost packet list. If it exists, the lost packet type is packet disorder.

[0062] Further, in the uplink speed measurement, whether the packet is lost can only be judged by the corresponding TCP data packet packet sequence number carried in the returned ACK packet, but there is also a situation that the returned ACK packet is lost although the TCP data packet is normally received by the lower device. At this time, the corresponding TCP data packet packet sequence number carried in the last returned ACK packet received by the gateway is also less than the expected packet sequence number. The TCP data packet corresponding to the missing sequence number between the corresponding TCP data packet packet sequence number carried in the ACK packet and the expected packet sequence number is also regarded as a lost packet, but at this time, the retransmission of the TCP data packet should not be performed. Therefore, it is also necessary to further judge according to the lost packet list. When the sequence number does not exist in the lost packet list, it indicates that only the returned ACK packet is discarded. In this case, if the server repeatedly retransmits or blocks due to the non-receipt of the returned ACK, the corresponding ACK packet is retransmitted to the server; if the speed measurement process can continue normally, the retransmission of the ACK packet is not needed.

[0063] After the lost packet is obtained, the supplemented packet corresponding to the lost packet can be constructed according to the saved header quintuple. Specifically, the saved header quintuple is obtained according to the packet sequence number of the lost packet, the saved header quintuple is taken as the header quintuple of the supplemented packet, the data payload of the supplemented packet is randomly generated, and the header quintuple and the data payload of the supplemented packet are combined into the supplemented packet.

[0064] After the supplemented packet is constructed, the supplemented packet can be forwarded according to the lost packet type, and the corresponding packet supplement is completed.

[0065] (1) When the lost packet type is packet loss, the corresponding supplemented packet is forwarded, and the expected packet sequence number is updated.

[0066] If no packet is received in the specified time period, the gateway retransmits the corresponding packet to the receiving end after the timer expires, and updates the expected packet sequence number, so as to avoid the performance reduction caused by retransmission of the sending end.

[0067] (2) When the packet loss type is packet disorder, the corresponding TCP data packet is forwarded, and the expected packet sequence number is not updated.

[0068] If the out-of-order packet or retransmission packet is received within the specified time period, the corresponding TCP data packet is immediately forwarded, and no packet needs to be constructed, so as to avoid the performance reduction caused by the construction of the packet.

[0069] Through the above process, the packet loss packet can be completed, and the performance of the download speed test can be improved. For different packet loss types, the forwarding of the packet or the TCP data packet can be regarded as no packet loss, and therefore the corresponding sequence number needs to be removed from the packet loss list.

[0070] Further, since the packet can be regarded as no packet loss after the gateway completes the packet, the gateway can immediately return the ACK packet corresponding to the packet to the sending end, without waiting for the ACK packet returned by the receiving end, so as to further improve the speed test efficiency. In this processing mode, since the gateway has replied the ACK packet, the gateway directly discards the ACK packet returned by the receiving end and does not forward it, so as to avoid the session confusion.

[0071] On the other hand, in the TCP protocol, the receiving end will reply an ACK message to the sending end after receiving each TCP data message, informing the sending end that the corresponding TCP data message has been received and requesting the next TCP data message from the sending end. During the speed measurement process, the down-hung device needs to reply a corresponding uplink ACK message to the server after receiving the downlink TCP data message sent by the server; the server needs to reply a downlink ACK message to the down-hung device after receiving the uplink TCP data message sent by the down-hung device. The above two kinds of ACK messages will also cause packet loss between the gateway and the down-hung device. In order to avoid this situation, in the method provided by the embodiment, the gateway counts the ACK messages in a unit of time by means of ACK aggregation, and forwards the aggregated ACK messages. After aggregating the ACK messages and forwarding them, the processing pressure of the wireless module on small packets can be reduced, and ACK message loss can be avoided. Specifically, starting a timer from receiving the first ACK message, counting and saving the ACK messages in the range of retransmission timeout Tto / 2 according to an experience value. The ACK messages are not forwarded within the time of the timer, and after Tto / 2, the ACK sequence numbers of the aggregated ACK messages are summed up according to the processing requirements of the wireless driver, combined into one ACK message, and replied to the down-hung terminal device. From the TCP protocol, the aggregated ACK message can also be regarded as a normal reply to the related upload data message, which can reduce the processing pressure of the wireless module on small packets. For example, in Figure 5 In the embodiment, the gateway receives the ACK messages ACK1, ACK2, ACK4 and ACK4, aggregates them into one ACK message "ACK aggregation" and forwards it. In order to ensure that the returned ACK message can accurately reflect the real packet loss in the speed measurement process, the aggregation is performed according to the real number of ACK messages, without packet supplement of the ACK messages.

[0072] The method for improving the TCP speed measurement performance provided by the embodiment reduces the influence of packet loss on the throughput of TCP interaction by supplementally processing the TCP data messages between the down-hung wireless device and the gateway in the process of TCP interaction through the gateway between the down-hung wireless device and the guard zone; and reduces the number of small packet processing by aggregating the ACK messages between the down-hung device and the gateway, thereby ensuring the stability of the speed measurement and other services in the interaction process. This method is simple and efficient, has high flexibility and strong applicability, and can achieve obvious optimization effect in the case of poor wireless air interface capability and high dependence of forwarding performance on gateway CPU resources.

[0073] Embodiment 2:

[0074] Based on the method for improving TCP speed test performance provided in the above embodiment 1, the application further provides a device for implementing the method for improving TCP speed test performance.

[0075] The device provided in the embodiment can be used for Figure 6 As shown in the speed test system, the gateway device, the system includes a speed test server, a gateway and a hanging device. When downloading speed test, the speed test server sends speed test messages to the hanging device through the gateway, and the hanging device sends ACK reply to the speed test messages sent by the speed test server through the gateway. When uploading speed test, the hanging device sends speed test messages to the speed test server, and the speed test server sends ACK reply to the speed test messages sent by the hanging device through the gateway. The gateway carries out packet supplement on the lost packet speed test messages and aggregation on the uplink ACK messages according to the method for improving TCP speed test performance provided in the embodiment 1 during downloading and uploading speed test.

[0076] As shown in the speed test system, the gateway device, the system includes a speed test server, a gateway and a hanging device. When downloading speed test, the speed test server sends speed test messages to the hanging device through the gateway, and the hanging device sends ACK reply to the speed test messages sent by the speed test server through the gateway. When uploading speed test, the hanging device sends speed test messages to the speed test server, and the speed test server sends ACK reply to the speed test messages sent by the hanging device through the gateway. The gateway carries out packet supplement on the lost packet speed test messages and aggregation on the uplink ACK messages according to the method for improving TCP speed test performance provided in the embodiment 1 during downloading and uploading speed test. Figure 7 As shown in the device architecture schematic diagram of the embodiment of the application, the device for improving TCP speed test performance of the embodiment includes one or more processors 11 and a memory 12. Wherein, Figure 7 The processor 11 and the memory 12 can be connected through a bus or other ways, Figure 7 For example, the connection through the bus.

[0077] The memory 12 is a kind of non-volatile computer readable storage medium for improving TCP speed test performance, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the method for improving TCP speed test performance in the embodiment 1. The processor 11 executes various functional applications and data processing of the device for improving TCP speed test performance by running the non-volatile software programs, instructions and modules stored in the memory 12, that is, the method for improving TCP speed test performance in the embodiment 1 is realized.

[0078] The memory 12 can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 12 can optionally include a memory remotely arranged relative to the processor 11, which can be connected to the processor 11 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0079] Program instructions / modules are stored in the memory 12, which execute the method for improving TCP speed test performance in the above embodiment 1 when executed by one or more processors 11, for example, execute various steps described above Figure 1 and Figure 3 as shown.

[0080] Those skilled in the art can understand that all or part of the steps in the various methods of the embodiments can be completed by instructing the related hardware with a program, and the program can be stored in a computer readable storage medium, which can include Read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disk, etc.

[0081] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for improving TCP throughput performance, the method comprising: Specifically comprising: The header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device is saved, and the packet sequence number of each TCP data packet and the acknowledgement number carried thereby are recorded, and whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; specifically comprising: the gateway obtains the expected packet sequence number of the next TCP data packet according to the recorded packet sequence number; in the uplink speed measurement, when the packet sequence number of the next TCP data packet sent by the hanging device to the speed measurement server is greater than the expected packet sequence number, the missing sequence number between the expected packet sequence number and the packet sequence number of the next TCP data packet is taken as the sequence number of the lost packet, and the lost packet type is packet loss; in the downlink speed measurement, when the corresponding TCP data packet packet sequence number carried in the ACK packet returned by the hanging device to the speed measurement server is less than the expected packet sequence number, the missing sequence number between the carried corresponding TCP data packet packet sequence number and the expected packet sequence number is taken as the sequence number of the lost packet, and the lost packet type is packet loss; The gateway obtains the sequence number of the lost packet according to the recorded packet sequence number and the returned ACK packet, and obtains the corresponding lost packet type, obtains the saved header quintuple according to the sequence number of the lost packet, constructs the corresponding retransmission packet of the lost packet according to the saved header quintuple, and forwards the retransmission packet according to the lost packet type; The method further comprises: recording the sequence number of the lost packet in a lost packet list, and judging whether the packet sequence number of the next TCP data packet received by the gateway is in the lost packet list when the packet sequence number is less than the expected packet sequence number; if yes, the lost packet type is packet reordering.

2. The method for TCP throughput performance enhancement according to claim 1, wherein, The header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device is saved, and the packet sequence number of each TCP data packet and the acknowledgement number carried thereby are recorded, and whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; specifically comprising: In the downlink speed measurement, the gateway saves the header quintuple of each TCP data packet sent by the speed measurement server to the hanging device, and records the packet sequence number of each TCP data packet and the acknowledgement number carried thereby; In the uplink speed measurement, the gateway saves the header quintuple of each TCP data packet sent by the hanging device to the speed measurement server, and records the packet sequence number of each TCP data packet and the acknowledgement number carried thereby.

3. The method for TCP throughput performance enhancement according to claim 2, wherein, The header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device is saved, and the packet sequence number of each TCP data packet and the acknowledgement number carried thereby are recorded, and whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; specifically comprising: The buffer size for storing the TCP data packet quintuple is: retransmission timeout time * maximum window value of the receiving end * length of the packet header; The buffer size for storing the ACK header quintuple is: retransmission timeout time * maximum window value of the sending end * length of the packet header.

4. The method for TCP throughput performance enhancement according to claim 1, wherein, The header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device is saved, and the packet sequence number of each TCP data packet and the acknowledgement number carried thereby are recorded, and whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; specifically comprising: The saved header quintuple is taken as the header quintuple of the retransmission packet, the data payload of the retransmission packet is randomly generated, and the header quintuple and the data payload of the retransmission packet are combined into the retransmission packet.

5. The method for TCP throughput performance enhancement according to claim 1, wherein, The header quintuple of each TCP data packet and the returned ACK packet between the gateway and the hanging device is saved, and the packet sequence number of each TCP data packet and the acknowledgement number carried thereby are recorded, and whether the TCP data packet is lost is judged according to the recorded packet sequence number, the carried acknowledgement number and the returned ACK packet; specifically comprising: When the packet loss type is packet loss, a corresponding retransmission packet is forwarded, and an expected packet sequence number is updated; When the packet loss type is packet disorder, a corresponding TCP data packet is forwarded, and the expected packet sequence number is not updated; After the retransmission packet or the TCP data packet is forwarded, the corresponding sequence number is removed from the packet loss list.

6. The method for TCP throughput performance enhancement according to claim 5, wherein, The method further comprises: The method further comprises:

7. The method for TCP throughput performance enhancement according to claim 1, wherein, The method further comprises: The gateway counts ACK packets in a unit of time, aggregates the received ACK packets, and forwards them uniformly.

8. A device for improving TCP throughput performance, characterized by, The device comprises at least one processor and a memory, the at least one processor and the memory are connected through a data bus, the memory stores instructions executable by the at least one processor, and the instructions are used to complete the method for improving the TCP measurement performance according to any one of claims 1-7 after being executed by the processor.

Citation Information

Patent Citations

  • Lost packet compensation method and device under user datagram protocol transmission mode

    CN101800632A

  • Data retransmission method, network device, and computer readable storage medium

    WO2022002043A1