CN114285762A - RTT updating method, updating device, processor and communication system - Google Patents

RTT updating method, updating device, processor and communication system Download PDF

Info

Publication number
CN114285762A
CN114285762A CN202111471056.1A CN202111471056A CN114285762A CN 114285762 A CN114285762 A CN 114285762A CN 202111471056 A CN202111471056 A CN 202111471056A CN 114285762 A CN114285762 A CN 114285762A
Authority
CN
China
Prior art keywords
rtt
message
updated
packet
target original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111471056.1A
Other languages
Chinese (zh)
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.)
Wangsu Science and Technology Co Ltd
Original Assignee
Wangsu Science and Technology 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 Wangsu Science and Technology Co Ltd filed Critical Wangsu Science and Technology Co Ltd
Priority to CN202111471056.1A priority Critical patent/CN114285762A/en
Publication of CN114285762A publication Critical patent/CN114285762A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application provides an update method, an update device, a processor and a communication system of RTT, wherein the method comprises the following steps: under the condition that the RTT is not updated or cannot be updated, sending an RTT detection message corresponding to a target original message to an opposite end, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated; recording the receiving time of the confirmation message under the condition of receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end under the condition of receiving the RTT detection message; and updating the RTT according to the sending time and the receiving time. According to the scheme, the sending time and the receiving time are collected through a detection means, and the RTT is updated, so that the problem that the RTT cannot be updated when a large number of retransmissions occur in the prior art under the condition that the TCP does not start the TCP _ timestamp function is solved.

Description

RTT updating method, updating device, processor and communication system
Technical Field
The present application relates to the field of internet technologies, and in particular, to an RTT updating method, an updating apparatus, a computer-readable storage medium, a processor, and a communication system.
Background
The idea of collecting RTT (Round-Trip Time, RTT) by TCP (Transmission Control Protocol, TCP for short) is as follows: recording the current timestamp (marked as T1) for each data message at the time of transmission, and when the opposite end responds to an Acknowledgement (ACK) (marked as T2), then calculating the difference of the time from transmission to Acknowledgement as RTT, namely RTT 2-T1.
In the related art, the TCP protocol records the time stamp of the data packet in the following two ways:
(1) recording the sending time of the message in each data message structure of a local sending queue, which is a default mode adopted by TCP, but when the data message is retransmitted (lost or false retransmission), and when an acknowledgement ACK message is received, because the original message or the retransmission message can not be confirmed, RTT can not be collected when the data message is retransmitted;
(2) based on the TCP timestamp option (TCP _ timestamp), if the TCP _ timestamp is started, the TCP data message is sent with the timestamp in the TCP protocol header option, and the opposite end receives the data message and then brings the timestamp back through the TCP protocol header option, so that it is possible to distinguish whether the ACK is an original message or a retransmission message, that is, it is possible to obtain the RTT during retransmission. However, TCP _ timestamp needs to be started simultaneously depending on the functions of both ends of the sending end and the receiving end, and in an NAT (Network Address Translation, NAT for short) Network, because timestamps of different machines are different, TCP cannot pass through paws (protection agent traversed sequences) check during three-way handshake, which results in a failure in connection establishment, and therefore TCP is rarely used in actual application.
When a large amount of packet loss occurs in a link, or due to sudden increase of time delay, an overtime retransmission (false retransmission) caused by delayed arrival of a packet is likely to occur, and all data packets in a sending window are retransmitted, so that RTT cannot be acquired by the data packets in the whole sending window, and thus updated RTT cannot be acquired by a TCP connection for a long time, further affecting an overtime mechanism and packet loss detection, and further causing more serious retransmission.
Therefore, a method for updating RTT when a large number of retransmissions occur by TCP without enabling TCP _ timestamp function is needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the technology described herein and, therefore, certain information may be included in the background that does not form the prior art that is already known in this country to a person of ordinary skill in the art.
Disclosure of Invention
The present application mainly aims to provide an RTT updating method, an updating apparatus, a computer-readable storage medium, a processor, and a communication system, so as to solve the problem in the prior art that RTT cannot be updated when TCP retransmits a large amount of data without enabling a TCP _ timestamp function.
According to an aspect of an embodiment of the present invention, there is provided a method for updating RTT, including: sending an RTT detection message corresponding to a target original message to an opposite end under the condition that RTT is not updated or cannot be updated, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated; recording the receiving time of the confirmation message under the condition of receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end under the condition of receiving the RTT detection message; and updating the RTT according to the sending time and the receiving time.
Optionally, the determining that the RTT is not updated or cannot be updated includes at least one of: determining that the RTT can not be updated under the condition that all data messages sent by the current sending window are marked as lost; under the condition that all data messages of the last sending window do not update the RTT, determining that the RTT is not updated; determining that the RTT is not updated when the RTT is not updated within a preset time, wherein the preset time is N times of a minimum RTT, the minimum RTT is the minimum value of all obtained RTTs, and N is greater than 1.
Optionally, the sending, when the RTT is not updated or cannot be updated, an RTT detection packet corresponding to the target original packet to the opposite end includes: under the condition that RTT is not updated or cannot be updated, marking a first predetermined mark in the target original message, wherein the first predetermined mark is used for representing the RTT detection message corresponding to the target original message to be sent; sending the RTT detection message corresponding to the target original message marked with the first predetermined mark to the opposite terminal; deleting the first predetermined mark marked on the target original message, and marking a second predetermined mark on the target original message, wherein the second predetermined mark is used for representing the RTT detection message corresponding to the target original message.
Optionally, the sending the RTT probe packet corresponding to the target original packet to the opposite end includes: determining the RTT detection message at least according to the target original message; and sending the RTT detection message to the opposite terminal.
Optionally, when there are a plurality of target original packets, determining the RTT probe packet at least according to the target original packet, where the determining includes: determining the length of the RTT detection message; in the plurality of target original messages, sequentially going forward from the last target original message, determining a predetermined original message meeting a predetermined condition, wherein the predetermined condition comprises at least one of the following conditions: the length of the predetermined original message is greater than the sum of the length of the RTT detection message and an offset value, a selective acknowledgement message has not been sent by the opposite terminal, and the RTT detection message has been marked lost and is not retransmitted, wherein the offset value is an offset of an initial sequence number of the RTT detection message in the predetermined original message, and the predetermined original message is one of the target original messages; determining a starting sequence number and an ending sequence number of a target RTT detection message according to the length of the RTT detection message, the deviation value and the starting data of the preset original message; and copying data from the starting sequence number to the ending sequence number in the preset original message to obtain the RTT detection message.
Optionally, the acknowledgment packet is a selective acknowledgment packet or a duplicate selective acknowledgment packet, and the updating method further includes: receiving the selection confirmation message sent by the opposite end, wherein the selection confirmation message is also sent under the condition that the opposite end does not receive the target original message corresponding to the RTT detection message; and receiving the duplicate selection confirmation message sent by the opposite end, wherein the duplicate selection confirmation message is also sent by the opposite end under the condition of receiving the target original message corresponding to the RTT detection message.
Optionally, the updating method further includes: determining whether the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message or not under the condition of receiving the selective acknowledgement message or the repeated selective acknowledgement message sent by the opposite terminal; and under the condition that the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message, determining the selective acknowledgement message or the repeated selective acknowledgement message as a response to the RTT detection message.
Optionally, updating the RTT according to the sending time and the receiving time includes: calculating a difference between the sending time and the receiving time; and updating the RTT according to the difference value.
According to another aspect of the embodiments of the present invention, there is also provided an RTT updating apparatus, including: a sending unit, configured to send, to an opposite end, an RTT detection packet corresponding to a target original packet when RTT is not updated or cannot be updated, and record sending time of the RTT detection packet, where the target original packet is an original packet corresponding to the RTT which is not updated or cannot be updated; a recording unit, configured to record, when receiving a confirmation message sent by the opposite end, a receiving time of the confirmation message, where the confirmation message is sent by the opposite end when receiving the RTT detection message; and the updating unit is used for updating the RTT according to the sending time and the receiving time.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium including a stored program, wherein the program executes any one of the update methods.
According to still another aspect of the embodiments of the present invention, there is further provided a processor, where the processor is configured to execute a program, where the program executes any one of the update methods.
According to an aspect of the embodiments of the present invention, there is also provided a communication system, including: one or more processors, memory, and one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing any of the methods described herein.
In the embodiment of the present invention, in the RTT updating method, first, when it is determined that RTT is not updated or cannot be updated, an RTT detection packet corresponding to a target original packet is sent to an opposite end, and a sending time of the RTT detection packet is recorded, then, when an acknowledgement packet sent by the opposite end is received, a receiving time of the acknowledgement packet is recorded, where the acknowledgement packet is sent by the opposite end when the RTT detection packet is received, and finally, the RTT is updated according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, which is similar to the prior art when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, collecting the sending time and the receiving time by a detection means when judging that the RTT is not updated or cannot be updated, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection because the RTT is not updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 shows a schematic diagram of an update method of RTT according to an embodiment of the present application;
fig. 2 shows a schematic diagram of an apparatus for updating RTT according to an embodiment of the present application;
figure 3 shows a schematic diagram of an RTT probing mechanism according to an embodiment of the present application;
FIG. 4 shows a timing diagram of a TCP data flow according to an embodiment of the present application;
FIG. 5 shows a timing diagram of a TCP data flow according to yet another embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all 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 application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
As mentioned in the background art, in the TCP in the prior art, when a TCP _ timestamp function is not enabled, RTT cannot be updated when a large number of retransmissions occur.
According to an embodiment of the present application, there is provided an update method of RTT.
Fig. 1 is a flowchart of an RTT updating method according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S101, under the condition that RTT is not updated or cannot be updated, sending an RTT detection message corresponding to a target original message to an opposite end, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated;
step S102, recording the receiving time of the confirmation message when receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end when receiving the RTT detection message;
step S103, updating the RTT according to the transmission time and the reception time.
In the RTT updating method, first, when it is determined that the RTT is not updated or cannot be updated, an RTT probe packet corresponding to a target original packet is sent to an opposite end, and a sending time of the RTT probe packet is recorded, then, when an acknowledgment packet sent by the opposite end is received, a receiving time of the acknowledgment packet is recorded, where the acknowledgment packet is sent by the opposite end when the RTT probe packet is received, and finally, the RTT is updated according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
In order to determine that the RTT is not updated or cannot be updated more quickly, in an embodiment of the present application, the determining that the RTT is not updated or cannot be updated includes at least one of: determining that the RTT can not be updated under the condition that all data messages sent by the current sending window are marked as lost; determining that the RTT is not updated under the condition that all data messages of the last sending window do not update the RTT; and determining that the RTT is not updated when the RTT is not updated for a predetermined time, the predetermined time being N times a minimum RTT that is a minimum value of all obtained RTTs, N being greater than 1.
In an actual application process, the RTT may be continuously updated, so that the RTT may be continuously collected, where the minimum RTT is a minimum value of all the obtained RTTs, and the minimum RTT may be a value that is continuously updated according to the collected RTTs. In the present application, N is greater than 1, that is, N may be an integer greater than 1 or a non-integer greater than 1, and for example, N may be 1.1 or 1.5.
In another embodiment of the present application, the sending the RTT probe packet corresponding to the target original packet to the opposite end when the RTT is not updated or cannot be updated includes: under the condition that RTT is not updated or cannot be updated, marking a first preset mark in the target original message, wherein the first preset mark is used for representing the RTT detection message corresponding to the target original message to be sent; sending the RTT probe packet corresponding to the target original packet marked with the first predetermined flag to the peer end; deleting the first predetermined flag marked on the target original message, and marking a second predetermined flag on the target original message, where the second predetermined flag is used to represent that the RTT detection message corresponding to the target original message has been sent. In this embodiment, a first predetermined flag is marked in the target original message for which the RTT probe message needs to be sent, after the RTT probe message corresponding to the target original message is sent, the first predetermined flag is deleted, and a second predetermined flag is marked in the target original message, so that it is ensured that which target original messages need to send the RTT probe message and which target original messages have sent the RTT probe message can be known more clearly, and it is ensured that the target original messages can be managed more conveniently.
In a specific embodiment of the present application, under a condition that it is determined that the RTT is not updated or cannot be updated, a flag of the RTT detection message to be sent is marked, and the flag is marked as flag _ probe _ needed, which is a first predetermined flag; after the RTT detection message is sent, the flag _ probe _ needed flag is deleted, and a flag indicating that the RTT detection message has been sent is set, which is marked as flag _ probe _ send, and is the second predetermined flag.
In order to ensure that the RTT probe packet can be determined more accurately and that the sequence number of the determined RTT probe packet is within the range of the target original packet, in another embodiment of the present application, the sending the RTT probe packet corresponding to the target original packet to the opposite end includes: determining the RTT detection message at least according to the target original message; and sending the RTT detection message to the opposite terminal.
In another embodiment of the present application, determining the RTT detection packet at least according to the target original packet includes: determining the length and the offset value of the RTT detection message; determining a target initial sequence number according to the initial sequence number of the target original message and the offset value, and determining a target ending sequence number according to the target initial sequence number and the length of the RTT detection message; and copying target data between the target starting sequence number and the target ending sequence number in the target original message to obtain the RTT detection message. In this embodiment, the length and the offset value of the RTT probe packet are determined, and then the target start sequence number and the target end sequence number of the RTT probe packet are determined according to the start sequence number of the target original packet, the length of the RTT probe packet, and the offset value, so that it can be further ensured that the determined sequence number of the RTT probe packet is within the range of the target original packet.
It should be noted that the above embodiment corresponds to the case where there is only one target original message. In addition, the offset value is an offset of a target start sequence number of the RTT probe packet with respect to a start sequence number of the target original packet. Due to the existence of the offset value, the target starting sequence number of the RTT probe packet can be further ensured to be within the range of the target original packet.
In a specific embodiment of the present application, in a case that only one target original packet needs to be retransmitted, one target original packet is a data Segment (Segment), and in a case that the length of the data Segment is a Maximum data Segment length (MSS), a start sequence number and an end sequence number corresponding to the target original packet are PKTs (1,1001). Meanwhile, setting the offset value to be 10 and the length of the RTT PROBE packet to be 512, obtaining a target start sequence of the RTT PROBE packet to be 11 according to the offset value and a start sequence corresponding to the target original packet, obtaining a target end sequence of the RTT PROBE packet to be 523 according to the target start sequence of the RTT PROBE packet and the length of the RTT PROBE packet, that is, the target start sequence and the target end sequence of the RTT PROBE packet to be PROBE (11,523), and copying target data between PROBEs (11,523) in the target original packet to obtain the RTT PROBE packet.
In order to further ensure that the sequence number of the RTT probe packet is within the range of the target original packet, and to enable the opposite end to preferentially respond to a selection acknowledgement packet when receiving the RTT probe packet, in an embodiment of the present application, when there are a plurality of target original packets, determining the RTT probe packet at least according to the target original packet includes: determining the length of the RTT detection message; in a plurality of the target original messages, starting from the last target original message, determining a predetermined original message meeting a predetermined condition, where the predetermined condition includes at least one of: the length of the predetermined original message is greater than the sum of the length of the RTT probe message and an offset value, a selective acknowledgement message has not been sent by the opposite end, and the RTT probe message has been marked lost and is not retransmitted, wherein the offset value is an offset of the start sequence number of the RTT probe message in the predetermined original message, and the predetermined original message is one of the target original messages; determining a starting sequence number and an ending sequence number of a target RTT detection message according to the length of the RTT detection message, the deviation value and the starting data of the preset original message; and copying data from the initial sequence number to the end sequence number in the preset original message to obtain the RTT detection message.
In an actual application process, the length of the RTT probe packet may be configured according to an actual application scenario, but because a characteristic that the packet length is preferentially passed when the packet length is small may exist in a link, generally, the length of the RTT probe packet is not suitably configured to be small, but not suitably configured to be large, and in a case that the length configuration of the RTT probe packet is large, a sequence number of the RTT probe packet is easily made to exceed a range of a predetermined original packet.
In a specific embodiment of the present application, in a case that there are a plurality of target original messages, one target original message is a data segment, where the length of the data segment is the maximum data segment length, that is, data carrying 1000 bytes, a local end may send 10 target original messages according to the size of a sending window, that is, the sent data message is PKT (1,10001), in a case that it is determined that all the target original messages need to be retransmitted, a predetermined original message meeting a predetermined condition is determined sequentially from the last target original message, where the predetermined original message is the 10 th target original message meeting the predetermined condition, that is, the start sequence number and the end sequence number of the 10 th target original message are PKT (9001,10001), and meanwhile, the offset value is set to 10, according to the start sequence number and the offset value of the 10 th target original message, the target start sequence number of the RTT PROBE packet may be 9011, and the target end sequence number of the RTT PROBE packet may be 9523 according to the target start sequence number of the RTT PROBE packet and the length of the RTT PROBE packet, that is, the target start sequence number and the target end sequence number of the RTT PROBE packet are PROBE (9011,9523), so that it is further ensured that the sequence number of the RTT PROBE packet, that is, PROBE (9011,9523) is within the range of the 10 th target original packet PKT (9001,10001), and since the 10 th target original packet meets a predetermined condition, for example, an opposite end receives the RTT PROBE packet PROBE (9011,9523) first and does not receive the original packet PKT (9001,10001), the opposite end preferentially sends a selection acknowledgement packet SACK rather than a duplicate selection acknowledgement packet D-SACK when receiving the RTT PROBE packet.
In another embodiment of the present application, the acknowledgment packet is a selective acknowledgment packet or a duplicate selective acknowledgment packet, and the updating method further includes: receiving the selection confirmation message sent by the opposite end, wherein the selection confirmation message is also sent under the condition that the opposite end does not receive the target original message corresponding to the RTT detection message; receiving the duplicate selection acknowledgement message sent by the opposite end, where the duplicate selection acknowledgement message is also sent by the opposite end when receiving the target original message corresponding to the RTT detection message, and subsequently, when receiving the selection acknowledgement message or the duplicate selection acknowledgement message, recording a receiving time, calculating the RTT according to the sending time and the receiving time, and updating the RTT.
In order to determine that the received selective acknowledgement packet or the duplicate selective acknowledgement packet is a response to the RTT probe packet more quickly, and further ensure that the RTT can be updated more accurately, in another embodiment of the present application, the updating method further includes: determining whether the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message or not when the selective acknowledgement message or the repeated selective acknowledgement message sent by the opposite terminal is received; and under the condition that the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message, determining the selective acknowledgement message or the repeated selective acknowledgement message as a response to the RTT detection message.
Specifically, the sequence number of the selective acknowledgement packet or the duplicate selective acknowledgement packet includes a start sequence number and an end sequence number, and it is determined whether the sequence number of the selective acknowledgement packet or the duplicate selective acknowledgement packet is consistent with the sequence number of the RTT probe packet, that is, when the target start sequence number and the target end sequence number of the RTT probe packet are strictly matched with the start sequence number and the end sequence number of the acknowledgment packet, determining the selective acknowledgement message or the duplicate selective acknowledgement message as a response to the RTT probe message, for example, the target start sequence number and the target end sequence number of the RTT PROBE packet are PROBE (9011,9523), the initial sequence number of the received confirmation message is SACK (9011,9523) or D-SACK (9011,9523), and the two are considered to be strictly matched, namely, the selection confirmation message or the repeated selection confirmation message is determined to be a response to the RTT detection message.
In another embodiment of the present application, updating the RTT according to the transmission time and the reception time includes: calculating a difference between the sending time and the receiving time; and updating the RTT according to the difference value. In this embodiment, the RTT is updated according to the calculated difference by calculating the difference between the sending time and the receiving time, which ensures that the RTT can be updated more easily.
The embodiment of the present application further provides an RTT updating apparatus, and it should be noted that the RTT updating apparatus according to the embodiment of the present application may be used to execute the RTT updating method provided in the embodiment of the present application. The following describes an RTT updating apparatus according to an embodiment of the present application.
Fig. 2 is a schematic diagram of an apparatus for updating RTT according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
a sending unit 10, configured to send, to an opposite end, an RTT probe packet corresponding to a target original packet when RTT is not updated or cannot be updated, and record sending time of the RTT probe packet, where the target original packet is an original packet corresponding to the RTT that is not updated or cannot be updated;
a recording unit 20, configured to record, when receiving an acknowledgment packet sent by the peer, a receiving time of the acknowledgment packet, where the acknowledgment packet is sent by the peer when receiving the RTT probe packet;
an updating unit 30, configured to update the RTT according to the sending time and the receiving time.
In the RTT updating apparatus, the sending unit is configured to send, to an opposite end, an RTT detection packet corresponding to a target original packet when the RTT is not updated or cannot be updated, and record a sending time of the RTT detection packet, where the target original packet is an original packet corresponding to the RTT that is not updated or cannot be updated; the recording unit is configured to record, when receiving an acknowledgment packet sent by the peer, a receiving time of the acknowledgment packet, where the acknowledgment packet is sent by the peer when receiving the RTT probe packet; the updating unit is used for updating the RTT according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
In order to determine that the RTT is not updated or cannot be updated more quickly, in an embodiment of the present application, the determining that the RTT is not updated or cannot be updated includes at least one of: determining that the RTT can not be updated under the condition that all data messages sent by the current sending window are marked as lost; determining that the RTT is not updated under the condition that all data messages of the last sending window do not update the RTT; and determining that the RTT is not updated when the RTT is not updated for a predetermined time, the predetermined time being N times a minimum RTT that is a minimum value of all obtained RTTs, N being greater than 1.
In an actual application process, the RTT may be continuously updated, so that the RTT may be continuously collected, where the minimum RTT is a minimum value of all the obtained RTTs, and the minimum RTT may be a value that is continuously updated according to the collected RTTs. In the present application, N is greater than 1, that is, N may be an integer greater than 1 or a non-integer greater than 1, and for example, N may be 1.1 or 1.5.
In another embodiment of the present application, the sending unit includes a first marking module, a first sending module, and a second marking module, where the first marking module is configured to mark a first predetermined flag in the target original packet when RTT is not updated or cannot be updated, and the first predetermined flag is used to represent the RTT detection packet corresponding to the target original packet to be sent; the first sending module is configured to send the RTT probe packet corresponding to the target original packet marked with the first predetermined flag to the opposite end; the second marking module is configured to delete the first predetermined flag marked on the target original packet, and mark a second predetermined flag on the target original packet, where the second predetermined flag is used to represent that the RTT detection packet corresponding to the target original packet has been sent. In this embodiment, a first predetermined flag is marked in the target original message for which the RTT probe message needs to be sent, after the RTT probe message corresponding to the target original message is sent, the first predetermined flag is deleted, and a second predetermined flag is marked in the target original message, so that it is ensured that which target original messages need to send the RTT probe message and which target original messages have sent the RTT probe message can be known more clearly, and it is ensured that the target original messages can be managed more conveniently.
In a specific embodiment of the present application, under a condition that it is determined that the RTT is not updated or cannot be updated, a flag of the RTT detection message to be sent is marked, and the flag is marked as flag _ probe _ needed, which is a first predetermined flag; after the RTT detection message is sent, the flag _ probe _ needed flag is deleted, and a flag indicating that the RTT detection message has been sent is set, which is marked as flag _ probe _ send, and is the second predetermined flag.
In order to ensure that the RTT probe packet can be determined more accurately and that the sequence number of the RTT probe packet is within the range of the target original packet, in another embodiment of the present application, the sending unit further includes a determining module and a second sending module, where the determining module is configured to determine the RTT probe packet at least according to the target original packet; the second sending module is configured to send the RTT probe packet to the peer end.
In yet another embodiment of the present application, the determining module includes a first determining submodule, a second determining submodule, and a first copying submodule, where the first determining submodule is configured to determine a length and an offset value of the RTT probe packet; the second determining submodule is configured to determine a target starting sequence number according to the starting sequence number of the target original packet and the offset value, and determine a target ending sequence number according to the target starting sequence number and the length of the RTT probe packet; the first duplication sub-module is configured to duplicate target data between the target start sequence number and the target end sequence number in the target original message to obtain the RTT probe packet. In this embodiment, the length and the offset value of the RTT probe packet are determined, and then the target start sequence number and the target end sequence number of the RTT probe packet are determined according to the start sequence number of the target original packet, the length of the RTT probe packet, and the offset value, so that it can be further ensured that the determined sequence number of the RTT probe packet is within the range of the target original packet.
It should be noted that the above embodiment corresponds to the case where there is only one target original message. In addition, the offset value is an offset of a target start sequence number of the RTT probe packet with respect to a start sequence number of the target original packet. Due to the existence of the offset value, the target starting sequence number of the RTT probe packet can be further ensured to be within the range of the target original packet.
In a specific embodiment of the present application, in a case that only one target original packet needs to be retransmitted, one target original packet is a data Segment (Segment), and in a case that the length of the data Segment is a Maximum data Segment length (MSS), a start sequence number and an end sequence number corresponding to the target original packet are PKTs (1,1001). Meanwhile, setting the offset value to be 10 and the length of the RTT PROBE packet to be 512, obtaining a target start sequence of the RTT PROBE packet to be 11 according to the offset value and a start sequence corresponding to the target original packet, obtaining a target end sequence of the RTT PROBE packet to be 523 according to the target start sequence of the RTT PROBE packet and the length of the RTT PROBE packet, that is, the target start sequence and the target end sequence of the RTT PROBE packet to be PROBE (11,523), and copying target data between PROBEs (11,523) in the target original packet to obtain the RTT PROBE packet.
In order to further ensure that the sequence number of the RTT probe packet is within the range of the target original packet, and to enable the peer end to preferentially respond to the selection of an acknowledgement packet when receiving the RTT probe packet, in an embodiment of the present application, when there are a plurality of target original packets, the determining module further includes a third determining sub-module, a fourth determining sub-module, a fifth determining sub-module, and a second duplicating sub-module, where the third determining sub-module is configured to determine the length of the RTT probe packet; the fourth determining submodule is configured to determine, in a plurality of target original messages, a predetermined original message that satisfies a predetermined condition from a last target original message to a previous target original message, where the predetermined condition includes at least one of: the length of the predetermined original message is greater than the sum of the length of the RTT probe message and an offset value, a selective acknowledgement message has not been sent by the opposite end, and the RTT probe message has been marked lost and is not retransmitted, wherein the offset value is an offset of the start sequence number of the RTT probe message in the predetermined original message, and the predetermined original message is one of the target original messages; the fifth determining submodule is configured to determine a starting sequence number and an ending sequence number of a target RTT probe packet according to the length of the RTT probe packet, the offset value, and starting data of the predetermined original packet; the second duplication sub-module is configured to duplicate data from the starting sequence number to the ending sequence number in the predetermined original message to obtain the RTT probe packet.
In an actual application process, the length of the RTT probe packet may be configured according to an actual application scenario, but because a characteristic that the packet length is preferentially passed when the packet length is small may exist in a link, generally, the length of the RTT probe packet is not suitably configured to be small, but not suitably configured to be large, and in a case that the length configuration of the RTT probe packet is large, a sequence number of the RTT probe packet is easily made to exceed a range of a predetermined original packet.
In a specific embodiment of the present application, in a case that there are a plurality of target original messages, one target original message is a data segment, where the length of the data segment is the maximum data segment length, that is, data carrying 1000 bytes, a local end may send 10 target original messages according to the size of a sending window, that is, the sent data message is PKT (1,10001), in a case that it is determined that all the target original messages need to be retransmitted, a predetermined original message meeting a predetermined condition is determined sequentially from the last target original message, where the predetermined original message is the 10 th target original message meeting the predetermined condition, that is, the start sequence number and the end sequence number of the 10 th target original message are PKT (9001,10001), and meanwhile, the offset value is set to 10, according to the start sequence number and the offset value of the 10 th target original message, the target start sequence number of the RTT PROBE packet may be 9011, and the target end sequence number of the RTT PROBE packet may be 9523 according to the target start sequence number of the RTT PROBE packet and the length of the RTT PROBE packet, that is, the target start sequence number and the target end sequence number of the RTT PROBE packet are PROBE (9011,9523), so that it is further ensured that the sequence number of the RTT PROBE packet, that is, PROBE (9011,9523) is within the range of the 10 th target original packet PKT (9001,10001), and since the 10 th target original packet meets a predetermined condition, for example, an opposite end receives the RTT PROBE packet PROBE (9011,9523) first and does not receive the original packet PKT (9001,10001), the opposite end preferentially sends a selection acknowledgement packet SACK rather than a duplicate selection acknowledgement packet D-SACK when receiving the RTT PROBE packet.
In another embodiment of the present application, the acknowledgment packet is a selective acknowledgment packet or a duplicate selective acknowledgment packet, and the updating apparatus further includes a first receiving unit and a second receiving unit, where the first receiving unit is configured to receive the selective acknowledgment packet sent by the opposite end, and the selective acknowledgment packet is sent when the opposite end does not receive the target original packet corresponding to the RTT detection packet; the second receiving unit is configured to receive the duplicate selection acknowledgement packet sent by the peer, where the duplicate selection acknowledgement packet is also sent by the peer under the condition that the peer receives the target original packet corresponding to the RTT probe packet, subsequently, under the condition that the selection acknowledgement packet or the duplicate selection acknowledgement packet is received, record a receiving time, calculate the RTT according to the sending time and the receiving time, and update the RTT.
In order to determine that the received selection acknowledgement message or the duplicate selection acknowledgement message is a response to the RTT probe message more quickly and further ensure that the RTT can be updated more accurately, in another embodiment of the present application, the updating apparatus further includes a first determining unit and a second determining unit, where the first determining unit is configured to determine whether a sequence number of the selection acknowledgement message or the duplicate selection acknowledgement message is consistent with a sequence number of the RTT probe message when receiving a response to the selection acknowledgement message or the duplicate selection acknowledgement message sent by an opposite end; the second determining unit is configured to determine that the selective acknowledgement packet or the duplicate selective acknowledgement packet is a response to the RTT probe packet when it is determined that the sequence number of the selective acknowledgement packet or the duplicate selective acknowledgement packet is identical to the sequence number of the RTT probe packet.
Specifically, the sequence number of the selective acknowledgement packet or the duplicate selective acknowledgement packet includes a start sequence number and an end sequence number, and it is determined whether the sequence number of the selective acknowledgement packet or the duplicate selective acknowledgement packet is consistent with the sequence number of the RTT probe packet, that is, when the target start sequence number and the target end sequence number of the RTT probe packet are strictly matched with the start sequence number and the end sequence number of the acknowledgment packet, determining the selective acknowledgement message or the duplicate selective acknowledgement message as a response to the RTT probe message, for example, the target start sequence number and the target end sequence number of the RTT PROBE packet are PROBE (9011,9523), the initial sequence number of the received confirmation message is SACK (9011,9523) or D-SACK (9011,9523), and the two are considered to be strictly matched, namely, the selection confirmation message or the repeated selection confirmation message is determined to be a response to the RTT detection message.
In yet another embodiment of the present application, the update unit further includes a calculation module and an update module, wherein the calculation module is configured to calculate a difference between the sending time and the receiving time; the updating module is used for updating the RTT according to the difference value. In this embodiment, the RTT is updated according to the calculated difference by calculating the difference between the sending time and the receiving time, which ensures that the RTT can be updated more easily.
In order to make the technical solutions of the present application more clearly understood and more obvious to those skilled in the art, the following description is given with reference to specific embodiments:
example 1
As shown in fig. 3 and fig. 4, it is assumed that the size of the maximum data segment length MSS of the current TCP connection is 1000, that is, each data packet carries 1000 bytes of data; the size of the current home terminal sending window is 10, namely, at most 10 data messages can be sent in the sending window; setting the length plen of the RTT detection message as 512 bytes and the offset value offset as 10;
1. the home terminal sends 10 data messages according to the size of the sending window, and the data messages are recorded as PKT (1,10001);
2. the data message PKT (1,10001) is totally lost and does not reach the opposite end;
3. the home terminal marks the data message PKT (1,10001) as lost;
4. the local terminal RTT detecting mechanism identifies the starting condition, that is, all the data packets sent by the current sending window in step 3 are marked as lost:
a) identifying that all data messages sent by the current sending window are marked as lost, namely all the data messages sent by the current sending window need to be retransmitted, determining a data message PKT (1,10001) as a target original message and setting a first preset mark for the target original message PKT (1,10001), namely setting a flag _ probe _ need mark;
b) the RTT detection sending process identifies a first preset flag _ probe _ need flag, and determines preset original messages meeting preset conditions from the tail of a queue of a target original message PKT (1,10001), namely from the last target original message in sequence, namely determines the target original message PKT (9001,10001) meeting the preset conditions as the preset original messages;
c) determining the RTT detection message as PROBE (9011,9523) according to the length of the RTT detection message, namely 512 bytes, the offset value offset10 bytes and the predetermined original message PKT (9001,10001), and copying the RTT detection message PROBE (9011,9523) from the predetermined original message PKT (9001,10001);
d) sending an RTT detection message PROBE (9011,9523), and recording the sending time, namely the current timestamp is T1;
e) deleting the first preset flag _ probe _ need flag, and setting a second preset flag, namely setting the flag _ probe _ send flag;
5. the home terminal retransmits 10 lost data messages RPKT (1,10001);
6. the opposite end receives RTT detection message PROBE (9011,9523) first, and responds to the selection confirmation message SACK (9011,9523) because the predetermined original message PKT (9001,10001) is not received;
7. if the opposite terminal receives the retransmission message RPKT (9001,10001), and if the opposite terminal protocol supports D-SACK, the opposite terminal responds to the repeated selection confirmation message D-SACK (9011,9523) because the opposite terminal already receives the RTT detection message PROBE (9011,9523) in the step 6;
8. the RTT detection mechanism of the home terminal identifies a second preset mark flag _ probe _ send mark and identifies all SACK and D-SACK messages;
a) receiving a selective acknowledgement message SACK (9011,9523), determining that the sequence number of the selective acknowledgement message SACK (9011,9523) exactly matches the sequence number of the RTT PROBE message PROBE (9011,9523), and confirming that the selective acknowledgement message SACK (9011,9523) is a response to the RTT PROBE message PROBE (9011,9523);
b) recording the receiving time, wherein the current time stamp is T2, calculating RTT (equal to T2-T1), and updating the RTT;
c) deleting the second predetermined flag _ probe _ send flag;
9. the home terminal receives the D-SACK (9011,9523) and does not process the D-SACK.
Example 2
As shown in fig. 3 and fig. 5, it is assumed that the size of the maximum data segment length MSS of the current TCP connection is 1000, that is, each data packet carries 1000 bytes of data; the size of the current home terminal sending window is 10, namely, at most 10 data messages can be sent in the sending window; the currently acquired minimum RTT value MIN _ RTT is 20 ms; setting the size of the RTT detection message as 512 bytes and the offset value offset as 10; setting the multiple N of the RTT detection trigger condition MIN _ RTT as 2;
1. the home terminal sends 10 data messages according to the size of the sending window, and the data messages are recorded as PKT (1,10001);
2. the data message PKT (1,10001) is delayed to reach the opposite end due to the link;
3. the RTT detecting mechanism at the local end recognizes the starting condition, that is, the data packet PKT (1,10001) in step 2 is delayed to reach the opposite end due to the link:
a) identifying that the time of not updating the RTT exceeds N × MIN _ RTT (namely exceeds 40 ms) by the RTT detection mechanism at the home terminal, determining a data message PKT (1,10001) as a target original message, and setting a first preset mark flag _ probe _ need mark for the target original message PKT (1,10001);
b) the RTT detection sending process identifies a first preset flag _ probe _ need flag, and determines preset original messages meeting preset conditions from the tail part of a target original message PKT (1,10001), namely from the last target original message in sequence, namely determines the target original message PKT (9001,10001) meeting the preset conditions as the preset original message;
c) determining the RTT detection message as PROBE (9011,9523) according to the length of the RTT detection message, namely 512 bytes, the offset value offset10 bytes and the predetermined original message PKT (9001,10001), and copying the RTT detection message PROBE (9011,9523) from the predetermined original message;
d) sending an RTT detection message PROBE (9011,9523), and recording the sending time, namely the current timestamp is T1;
e) deleting the first predetermined flag, flag _ probe _ need flag, and setting a second predetermined flag, namely, setting the flag _ probe _ send flag;
4. the home terminal marks the target original message PKT (1,10001) as lost;
5. the home terminal determines 10 target original messages PKT (1,10001) marked to be lost as retransmission data messages RPKT (1,10001), namely, false retransmission is carried out;
6. the opposite end receives 10 target original messages PKT (1,10001) which are delayed to arrive;
7. the opposite end receives an RTT detection message PROBE (9011,9523), and the opposite end responds to a repeated selection confirmation message D-SACK (9011,9523) because the target original message PKT (1,10001) is confirmed;
8. the opposite terminal receives 10 retransmission data messages RPKT (1,10001) sent by the home terminal and responds to a repeated selection confirmation message D-SACK (1,10001);
9. the RTT detection mechanism of the home terminal identifies a first preset mark flag _ probe _ send mark, and identifies all SACK and D-SACK messages:
a) receiving a repeated selection confirmation message D-SACK (9011,9523), determining that the sequence numbers of the repeated selection confirmation message D-SACK (9011,9523) and the RTT detection message PROBE (9011,9523) are strictly matched, and confirming that the repeated selection confirmation message D-SACK (9011,9523) is a response to the RTT detection message PROBE (9011,9523);
b) recording the receiving time, namely the current time stamp is T2, calculating RTT (equal to T2-T1), and updating the RTT;
c) deleting the second predetermined flag _ probe _ send;
10. the home terminal receives the D-SACK (1,10001) and does not process the D-SACK.
The RTT updating apparatus includes a processor and a memory, wherein the transmitting unit, the recording unit, the updating unit, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the problem that in the prior art, under the condition that TCP does not enable a TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved by adjusting kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, where the program, when executed by a processor, implements the RTT updating method.
An embodiment of the present invention provides a processor, where the processor is configured to execute a program, where the program executes an update method of the RTT when the program runs.
In an exemplary embodiment of the present application, there is also provided a communication system including: one or more processors, memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs comprising instructions for performing any of the above-described methods.
The communication system may perform the RTT updating method, where in the updating method, first, when it is determined that RTT is not updated or cannot be updated, an RTT probe packet corresponding to a target original packet is sent to an opposite end, and a sending time of the RTT probe packet is recorded, then, when an acknowledgement packet sent by the opposite end is received, a receiving time of the acknowledgement packet is recorded, where the acknowledgement packet is sent by the opposite end when the RTT probe packet is received, and finally, the RTT is updated according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein when the processor executes the program, at least the following steps are realized:
step S101, under the condition that RTT is not updated or cannot be updated, sending an RTT detection message corresponding to a target original message to an opposite end, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated;
step S102, recording the receiving time of the confirmation message when receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end when receiving the RTT detection message;
step S103, updating the RTT according to the transmission time and the reception time.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program of initializing at least the following method steps when executed on a data processing device:
step S101, under the condition that RTT is not updated or cannot be updated, sending an RTT detection message corresponding to a target original message to an opposite end, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated;
step S102, recording the receiving time of the confirmation message when receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end when receiving the RTT detection message;
step S103, updating the RTT according to the transmission time and the reception time.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as a separate product. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above methods according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
From the above description, it can be seen that the above-described embodiments of the present application achieve the following technical effects:
1) in the RTT updating method of the present application, first, when it is determined that RTT is not updated or cannot be updated, an RTT probe packet corresponding to a target original packet is sent to an opposite end, and a sending time of the RTT probe packet is recorded, then, when an acknowledgement packet sent by the opposite end is received, a receiving time of the acknowledgement packet is recorded, where the acknowledgement packet is sent by the opposite end when the RTT probe packet is received, and finally, the RTT is updated according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
2) In the RTT updating apparatus of the present application, a sending unit is configured to send, to an opposite end, an RTT detection packet corresponding to a target original packet when the RTT is not updated or cannot be updated, and record a sending time of the RTT detection packet, where the target original packet is an original packet corresponding to the RTT that is not updated or cannot be updated; the recording unit is configured to record, when receiving an acknowledgment packet sent by the peer, a receiving time of the acknowledgment packet, where the acknowledgment packet is sent by the peer when receiving the RTT probe packet; the updating unit is used for updating the RTT according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
3) The communication system of the present application may execute the RTT updating method, where in the updating method, first, when it is determined that RTT is not updated or cannot be updated, sending an RTT probe packet corresponding to a target original packet to an opposite end, and recording a sending time of the RTT probe packet, then, when an acknowledgement packet sent by the opposite end is received, recording a receiving time of the acknowledgement packet, where the acknowledgement packet is sent by the opposite end when the RTT probe packet is received, and finally, updating the RTT according to the sending time and the receiving time. In the scheme, under the condition that the RTT is not updated or can not be updated, the RTT detection message is sent to the opposite end, the sending time of the RTT detection message is recorded, and recording the receiving time of the confirmation message sent by the opposite terminal, according to the sending time and the receiving time, the RTT is updated, and compared with the prior art that when the tcp _ timestamp function is not enabled, compared with the situation that a large number of retransmissions cannot collect RTT, the scheme realizes that under the condition that the tcp _ timestamp function is not enabled, when the RTT is judged not to be updated or can not be updated, the sending time and the receiving time are collected by a detection means, and updates the RTT, thereby avoiding the influence of the time-out mechanism and the packet loss detection due to the RTT not being updated, and further more serious retransmission is caused, so that the problem that in the prior art, under the condition that the TCP does not start the TCP _ timestamp function, RTT cannot be updated when a large number of retransmissions occur is solved.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (12)

1. A method for updating RTT, comprising:
sending an RTT detection message corresponding to a target original message to an opposite end under the condition that RTT is not updated or cannot be updated, and recording the sending time of the RTT detection message, wherein the target original message is the original message corresponding to the RTT which is not updated or cannot be updated;
recording the receiving time of the confirmation message under the condition of receiving the confirmation message sent by the opposite end, wherein the confirmation message is sent by the opposite end under the condition of receiving the RTT detection message;
and updating the RTT according to the sending time and the receiving time.
2. The updating method of claim 1, wherein the determining that the RTT is not updated or cannot be updated comprises at least one of:
determining that the RTT can not be updated under the condition that all data messages sent by the current sending window are marked as lost;
under the condition that all data messages of the last sending window do not update the RTT, determining that the RTT is not updated;
determining that the RTT is not updated when the RTT is not updated within a preset time, wherein the preset time is N times of a minimum RTT, the minimum RTT is the minimum value of all obtained RTTs, and N is greater than 1.
3. The updating method according to claim 1, wherein the sending the RTT probe packet corresponding to the target original packet to the opposite end when the RTT is not updated or cannot be updated includes:
under the condition that RTT is not updated or cannot be updated, marking a first predetermined mark in the target original message, wherein the first predetermined mark is used for representing the RTT detection message corresponding to the target original message to be sent;
sending the RTT detection message corresponding to the target original message marked with the first predetermined mark to the opposite terminal;
deleting the first predetermined mark marked on the target original message, and marking a second predetermined mark on the target original message, wherein the second predetermined mark is used for representing the RTT detection message corresponding to the target original message.
4. The updating method according to any one of claims 1 to 3, wherein the sending the RTT probe packet corresponding to the target original packet to the opposite end includes:
determining the RTT detection message at least according to the target original message;
and sending the RTT detection message to the opposite terminal.
5. The updating method according to claim 4, wherein, in case that there are a plurality of target original packets, the determining the RTT probe packet according to at least the target original packet includes:
determining the length of the RTT detection message;
in the plurality of target original messages, sequentially going forward from the last target original message, determining a predetermined original message meeting a predetermined condition, wherein the predetermined condition comprises at least one of the following conditions: the length of the predetermined original message is greater than the sum of the length of the RTT detection message and an offset value, a selective acknowledgement message has not been sent by the opposite terminal, and the RTT detection message has been marked lost and is not retransmitted, wherein the offset value is an offset of an initial sequence number of the RTT detection message in the predetermined original message, and the predetermined original message is one of the target original messages;
determining a starting sequence number and an ending sequence number of a target RTT detection message according to the length of the RTT detection message, the deviation value and the starting data of the preset original message;
and copying data from the starting sequence number to the ending sequence number in the preset original message to obtain the RTT detection message.
6. The update method according to any one of claims 1 to 3, wherein the acknowledgement message is a selection acknowledgement message or a duplicate selection acknowledgement message, the update method further comprising:
receiving the selection confirmation message sent by the opposite end, wherein the selection confirmation message is also sent under the condition that the opposite end does not receive the target original message corresponding to the RTT detection message;
and receiving the duplicate selection confirmation message sent by the opposite end, wherein the duplicate selection confirmation message is also sent by the opposite end under the condition of receiving the target original message corresponding to the RTT detection message.
7. The updating method according to claim 6, wherein the updating method further comprises:
determining whether the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message or not under the condition of receiving the selective acknowledgement message or the repeated selective acknowledgement message sent by the opposite terminal;
and under the condition that the sequence number of the selective acknowledgement message or the repeated selective acknowledgement message is consistent with the sequence number of the RTT detection message, determining the selective acknowledgement message or the repeated selective acknowledgement message as a response to the RTT detection message.
8. The updating method according to any one of claims 1 to 3, wherein updating the RTT according to the sending time and the receiving time comprises:
calculating a difference between the sending time and the receiving time;
and updating the RTT according to the difference value.
9. An apparatus for updating RTT, comprising:
a sending unit, configured to send, to an opposite end, an RTT detection packet corresponding to a target original packet when RTT is not updated or cannot be updated, and record sending time of the RTT detection packet, where the target original packet is an original packet corresponding to the RTT which is not updated or cannot be updated;
a recording unit, configured to record, when receiving a confirmation message sent by the opposite end, a receiving time of the confirmation message, where the confirmation message is sent by the opposite end when receiving the RTT detection message;
and the updating unit is used for updating the RTT according to the sending time and the receiving time.
10. A computer-readable storage medium characterized by comprising a stored program, wherein the program executes the update method of any one of claims 1 to 8.
11. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the updating method of any one of claims 1 to 8.
12. A communication system, comprising: one or more processors, memory, and one or more programs stored in the memory and configured to be executed by the one or more processors, the one or more programs including instructions for performing the method of any of claims 1-8.
CN202111471056.1A 2021-12-03 2021-12-03 RTT updating method, updating device, processor and communication system Pending CN114285762A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111471056.1A CN114285762A (en) 2021-12-03 2021-12-03 RTT updating method, updating device, processor and communication system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111471056.1A CN114285762A (en) 2021-12-03 2021-12-03 RTT updating method, updating device, processor and communication system

Publications (1)

Publication Number Publication Date
CN114285762A true CN114285762A (en) 2022-04-05

Family

ID=80870812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111471056.1A Pending CN114285762A (en) 2021-12-03 2021-12-03 RTT updating method, updating device, processor and communication system

Country Status (1)

Country Link
CN (1) CN114285762A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1863033A (en) * 2005-05-14 2006-11-15 腾讯科技(深圳)有限公司 Method for obtaining network time over retransmission space and data transmission method in network
US7436778B1 (en) * 2003-05-12 2008-10-14 Sprint Communications Company, L.P. Related-packet identification
KR20110078564A (en) * 2009-12-31 2011-07-07 단국대학교 산학협력단 Update method of round trip time in communication protocol providing multi-homing function and communication apparatus providing multi-homing function
CN102217249A (en) * 2008-12-05 2011-10-12 株式会社Ntt都科摩 Communication apparatus and communication method
US20170346601A1 (en) * 2016-05-30 2017-11-30 Samsung Sds Co., Ltd. Data transmission method and computing apparatus having data transmission function

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7436778B1 (en) * 2003-05-12 2008-10-14 Sprint Communications Company, L.P. Related-packet identification
CN1863033A (en) * 2005-05-14 2006-11-15 腾讯科技(深圳)有限公司 Method for obtaining network time over retransmission space and data transmission method in network
CN102217249A (en) * 2008-12-05 2011-10-12 株式会社Ntt都科摩 Communication apparatus and communication method
KR20110078564A (en) * 2009-12-31 2011-07-07 단국대학교 산학협력단 Update method of round trip time in communication protocol providing multi-homing function and communication apparatus providing multi-homing function
US20170346601A1 (en) * 2016-05-30 2017-11-30 Samsung Sds Co., Ltd. Data transmission method and computing apparatus having data transmission function

Similar Documents

Publication Publication Date Title
CN108234087B (en) Data transmission method and sending end
US9426046B2 (en) Web page download time analysis
CN111371631B (en) Heartbeat mechanism detection method, terminal device and storage medium
JP3966711B2 (en) Proxy response method
CN1983911A (en) Method and system for faster detection and retransmission of lost tcp segments
CN107360247B (en) The method and the network equipment of processing business
CN106576108B (en) Communication method, equipment and system in communication system
CN102891883A (en) Wireless transmission control protocol processing method and equipment
US20140177462A1 (en) Network analysis method, information processing device, and computer-readable recording medium
CN112769939A (en) Big data reliable transmission method for real-time communication
CN111752803A (en) Method, device and medium for collecting and reporting buried point data
EP3264851B1 (en) Data transmission method and device for data service
JP2015023463A (en) Packet analyzing device, packet analyzing method, and packet analyzing program
CN114285762A (en) RTT updating method, updating device, processor and communication system
US8935387B2 (en) Information processing device, address duplication handling method, and computer-readable non-transitory recording medium
CN109067503B (en) Data retransmission method and device
CN108076070B (en) FASP (fast open shortest Path protocol) blocking method, device and analysis system
CN107733903B (en) Data transmission confirmation method based on UDP (user Datagram protocol) and base station
CN111953555A (en) Link detection method, CPE (customer premises equipment) and storage medium
CN113489786B (en) Reconnection method and retransmission method for weak network of long connection network
JP5462266B2 (en) Mobile communication network
CN107623562B (en) Data transmission method and device and electronic equipment
CN111064674B (en) Data transmission method, device and system
RU2396726C2 (en) Radio communication protocols for multichannel communication systems
CN113259490A (en) Multi-level node network data transmission method based on UDP transmission protocol

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