CN105610652B - Method and device for acquiring data transmission delay - Google Patents
Method and device for acquiring data transmission delay Download PDFInfo
- Publication number
- CN105610652B CN105610652B CN201610101530.4A CN201610101530A CN105610652B CN 105610652 B CN105610652 B CN 105610652B CN 201610101530 A CN201610101530 A CN 201610101530A CN 105610652 B CN105610652 B CN 105610652B
- Authority
- CN
- China
- Prior art keywords
- data packet
- transmission delay
- time
- sending
- receiving
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0852—Delays
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Synchronisation In Digital Transmission Systems (AREA)
Abstract
The invention relates to a method and a device for acquiring data transmission delay, wherein the method comprises the steps of acquiring the transmission delay of a first data packet as reference transmission delay; calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet and the sending time and the receiving time of the second data packet; wherein a transmission time of the first data packet is prior to a transmission time of the second data packet. According to the embodiment of the invention, the transmission delay of one data packet is used as the reference transmission delay, the transmission delay of other subsequent data packets can be calculated, the confirmation message does not need to be sent to each data packet, the time delay of data transmission among asynchronous devices can be quickly calculated, and the bandwidth load and the transmission flow can be reduced.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for obtaining data transmission delay.
Background
In the process of data transmission, as the clocks of the two devices cannot be completely synchronized, the round-trip transmission of the data packets can be adopted to count the delay of the data packet transmission. The specific method is that the receiving device receives the data and then replies an acknowledgement (ack) to the sending device, the sending device records the round trip time, and the round trip time is divided by 2 to obtain the transmission delay.
However, the method of counting delay by using round-trip transmission of data packets is adopted, and delay counting needs to be performed after the receiving device waits for ack to be replied every time the transmitting device transmits one data packet. Therefore, the bandwidth burden is doubled for the data transmission channel, and the statistical result of the delay can be given only after the sending device receives the ack replied by the receiving device, so that the real-time performance is not high.
Disclosure of Invention
Technical problem
In view of this, the technical problem to be solved by the present invention is how to increase the acquisition speed of data transmission delay.
Solution scheme
In order to solve the above technical problem, according to an embodiment of the present invention, a method for obtaining a data transmission delay is provided, including:
acquiring the transmission delay of the first data packet as a reference transmission delay;
calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet and the sending time and the receiving time of the second data packet;
wherein a transmission time of the first data packet is prior to a transmission time of the second data packet.
For the above method, in a possible implementation manner, acquiring the transmission delay of the first data packet as a reference transmission delay includes:
sending a synchronous data packet, and recording a sending time stamp of the synchronous data packet;
recording a receiving time stamp of the first data packet when the first data packet is received, wherein the first data packet is a confirmation message returned by responding to the synchronous data packet;
calculating the round trip time of transmission according to the receiving time stamp of the first data packet and the sending time stamp of the synchronous data packet;
and calculating the reference transmission delay according to the round trip time.
For the above method, in a possible implementation manner, calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet, and the sending time and the receiving time of the second data packet includes:
under the condition of receiving the second data packet, acquiring a sending time stamp for sending the second data packet from the second data packet, and recording a receiving time stamp for receiving the second data packet;
and calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time stamp and the receiving time stamp of the first data packet, and the sending time stamp and the receiving time stamp of the second data packet.
For the above method, in a possible implementation manner, calculating the transmission delay of the second data packet according to the reference transmission delay, the sending timestamp and the receiving timestamp of the first data packet, and the sending timestamp and the receiving timestamp of the second data packet includes:
the transmission delay of the second data packet is calculated using the following equation 1,
dn ═ t '-t1') - (tn-t1) + d1 formula 1,
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet.
For the above method, in a possible implementation manner, the method further includes:
retransmitting the synchronous data packet once every time interval set time period;
and under the condition that the transmission delay of the first data packet calculated this time is smaller than a set threshold value, adopting the transmission delay of the first data packet calculated this time as the reference transmission delay.
For the above method, in a possible implementation manner, the method further includes:
and under the condition that the transmission delay calculated this time is greater than a set threshold, adopting the transmission delay calculated last time as the reference transmission delay.
The invention also provides a device for obtaining the data transmission delay, which comprises:
an obtaining module, configured to obtain a transmission delay of the first data packet as a reference transmission delay;
a calculating module, connected to the obtaining module, configured to calculate a transmission delay of a second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet, and the sending time and the receiving time of the second data packet;
wherein a transmission time of the first data packet is prior to a transmission time of the second data packet.
For the apparatus, in a possible implementation manner, the obtaining module includes:
the first sending unit is used for sending a synchronous data packet and recording a sending time stamp for sending the synchronous data packet;
a first receiving unit, configured to record a receiving timestamp of the received first data packet when the first data packet is received, where the first data packet is an acknowledgement message returned in response to the synchronization data packet;
a first calculating unit, connected to the first sending unit and the first receiving unit, respectively, for calculating a round trip time of transmission according to a receiving timestamp of receiving the first data packet and a sending timestamp of sending the synchronous data packet;
and the second calculating unit is connected with the first calculating unit and used for calculating the reference transmission delay according to the round-trip time.
For the apparatus described above, in one possible implementation manner, the calculation module includes:
a second receiving unit, configured to, when the second data packet is received, obtain a sending timestamp for sending the second data packet from the second data packet, and record a receiving timestamp for receiving the second data packet;
and the third calculating unit is respectively connected with the second receiving unit, the second calculating unit and the first receiving unit and is used for calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time stamp and the receiving time stamp of the first data packet, and the sending time stamp and the receiving time stamp of the second data packet.
For the above apparatus, in a possible implementation manner, the third calculating unit calculates the transmission delay of the second data packet by using the following formula 1,
dn ═ t '-t1') - (tn-t1) + d1 formula 1,
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet.
For the above apparatus, in a possible implementation manner, the method further includes:
the updating module is used for retransmitting the synchronous data packet once every time interval set time period; and under the condition that the transmission delay of the first data packet calculated this time is smaller than a set threshold value, adopting the transmission delay of the first data packet calculated this time as the reference transmission delay.
For the apparatus, in a possible implementation manner, the updating module is further configured to adopt the previously calculated transmission delay as the reference transmission delay when the transmission delay calculated this time is greater than a set threshold.
Advantageous effects
According to the embodiment of the invention, the transmission delay of one data packet is used as the reference transmission delay, the transmission delay of other subsequent data packets can be calculated, the confirmation message does not need to be sent to each data packet, the time delay of data transmission among asynchronous devices can be quickly calculated, and the bandwidth load and the transmission flow can be reduced.
Other features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic diagram illustrating a method for acquiring data transmission delay according to an embodiment of the present invention;
fig. 2 is a schematic diagram illustrating the derivation process of formula 1 in the method for acquiring data transmission delay according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a method for acquiring a data transmission delay according to another embodiment of the present invention;
fig. 4 is a flowchart illustrating updating of a reference transmission delay in a data transmission delay acquisition method according to another embodiment of the present invention;
FIG. 5 is a diagram illustrating a sync packet in a method for acquiring a data transmission delay according to another embodiment of the present invention;
fig. 6 is a block diagram illustrating an architecture of an apparatus for obtaining data transmission delay according to an embodiment of the present invention;
fig. 7 is a block diagram illustrating an apparatus for acquiring a data transmission delay according to another embodiment of the present invention.
Detailed Description
Various exemplary embodiments, features and aspects of the present invention will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present invention. It will be understood by those skilled in the art that the present invention may be practiced without some of these specific details. In some instances, methods, procedures, components, and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present invention.
Example 1
Fig. 1 is a schematic diagram illustrating a method for acquiring data transmission delay according to an embodiment of the present invention. As shown in fig. 1, the method for obtaining data transmission delay mainly includes:
102, calculating the transmission delay of a second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet, and the sending time and the receiving time of the second data packet;
wherein a transmission time of the first data packet is prior to a transmission time of the second data packet.
In a possible implementation manner, step 101 may specifically include: sending a synchronous data packet, and recording a sending time stamp of the synchronous data packet; recording a receiving time stamp of the first data packet when the first data packet is received, wherein the first data packet is a confirmation message returned by responding to the synchronous data packet; calculating the round trip time of transmission according to the receiving time stamp of the first data packet and the sending time stamp of the synchronous data packet; and calculating the reference transmission delay according to the round trip time.
In a possible implementation manner, step 102 may specifically include: under the condition of receiving the second data packet, acquiring a sending time stamp for sending the second data packet from the second data packet, and recording a receiving time stamp for receiving the second data packet; and calculating the transmission delay of the second data packet according to the reference transmission delay, the sending time stamp and the receiving time stamp of the first data packet, and the sending time stamp and the receiving time stamp of the second data packet.
Specifically, the transmission delay of the second data packet can be calculated by using the following formula 1,
dn ═ t '-t1') - (tn-t1) + d1 formula 1,
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet.
Wherein the derivation process of formula 1 is as follows:
as shown in fig. 2, it is assumed that the data packets p1, p2... pn are transmitted by the transmitting device with transmission time stamps t1, t2.. tn. A data packet p1, p2... pn is received by the receiving device with a receive timestamp t1', t2.. tn'.
Let m be the clock reference difference between the transmitting device and the receiving device, d1 (reference) be the transmission delay of p1 packet (an example of the first packet), and dn be the transmission delay of pn packet.
Referring to fig. 2, a transmission time difference and a reception time difference between two packets may be represented by X1 through Xn and X1 'through Xn', where X1 is t2-t1 and Xn is tn-t (n-1); x1'═ t2' -t1', Xn' ═ tn '-t (n-1)'.
The time difference between transmission and reception of each packet is as follows 2 to 4:
t1' -t1 ═ m + d1 formula 2;
t2'-t2 ═ t2' - (t1+ x1) ═ t2'- (t1' -m-d1+ x1) ═ t2'-t1' -x1+ m + d1 formula 3;
……
where, equation 2 is the time difference of the packet p1, equation 3 is the time difference of the packet p2, and equation 4 is the time difference of the packet pn. Therefore, formula 1, dn ═ t '-t1') - (tn-t1) + d1 can be obtained from formula 4.
From the inference result, as long as the timestamp and the transmission delay of the data packet p1 transmitted for the first time are obtained, the transmission delay of other data packets pn (n >1) transmitted subsequently can be calculated. If the timestamp is positively retrievable, it is critical to retrieve the transmission delay d1 of the first transmitted packet p 1.
In a specific implementation, once a round trip synchronous (sync) transmission is made for the first time, t1, t1' are recorded, and d1 is obtained by dividing the round trip time by 2, the transmission delay of each data packet of the subsequent transmission can be calculated subsequently. For example, sync transmission can be initiated at the receiving end to calculate d1, and dn can be calculated at the receiving end, as described in the following embodiments. However, the present invention is not limited to a specific apparatus for calculating d1 and dn.
In the method for acquiring data transmission delay of this embodiment, the transmission delay of one data packet is used as a reference transmission delay, so that the transmission delay of other subsequent data packets can be calculated, an ack message does not need to be sent to each data packet, the time delay of data transmission between asynchronous devices can be quickly calculated, and bandwidth load and transmission flow can be reduced.
Example 2
As can be seen from the above-mentioned derivation of equation 1 from equations 2 to 3, since the derivation result substantially relates to only the transmission timestamp, the reception timestamp, and the transmission delay of p1, the transmission delay of pn transmitted by the transmitting device after p1 can be calculated by acquiring the transmission delay of p1 transmitted by the transmitting device. The present embodiment describes the data transmission delay obtaining method of the present invention by taking d1 calculated at the receiving device as an example. The d1 is calculated at the receiving device, so that the calculation result can be prevented from being influenced by the asynchronous clocks at the two ends. Specifically, d1 may be calculated by sending out a synchronization packet from the receiving device and waiting for an acknowledgement message to be returned by the sending device, where the acknowledgement message may be considered the first packet p1, see in particular the description below and fig. 3-5.
Fig. 3 is a flowchart illustrating a method for acquiring a data transmission delay according to another embodiment of the present invention. As a specific example of embodiment 1, in the present embodiment, the reference transmission delay is calculated at the receiving device, and the data transmission delay of a certain second data packet transmitted after the first data packet is calculated at the receiving device.
As shown in fig. 3, if it is assumed that the reference transmission delay is calculated in the receiving device in this embodiment, step 101 may specifically include:
Preferably, in this embodiment, also when the receiving device calculates a data transmission delay of a certain second data packet sent after the first data packet, step 102 may specifically include:
In addition, as shown in fig. 4, the method for acquiring data transmission delay in embodiments 1 and 2 may further include the step of updating the reference transmission delay:
and step 401, retransmitting the synchronous data packet once every set time period.
And 403, under the condition that the transmission delay of the first data packet calculated this time is smaller than the set threshold, adopting the transmission delay calculated this time as the reference transmission delay.
And step 404, when the transmission delay of the first data packet calculated this time is greater than a set threshold, adopting the transmission delay calculated last time as the reference transmission delay.
Specifically, the method for acquiring data transmission delay of the present invention performs error analysis: the main error depends on the reference transmission delay d1, and d1 is the time of one round trip transmission divided by 2, so that it cannot be known whether the time of 1/2 is occupied by each of transmission and reception in the round trip transmission.
For example, as shown in fig. 5, the receiving end sends out a sync packet to the sending end at time t 0', and waits for an ack message returned after the receiving end receives the sync packet (here, the ack message returned by the sending end may be regarded as p 1). If the receiving end receives the ack message returned by the transmitting end at t1', d1 is (t1' -t0 ')/2. And, the receiver can get the timestamp t1 of the sender sending out the ack. Then, if pn is received at the receiving end tn ', a timestamp tn of pn sent by the sending end and a timestamp tn' of pn received by the receiving end can be obtained. Finally, the calculation result of dn can be obtained by substituting t1, t1', tn' and d1 into formula 1dn ═ t '-t1') - (tn-t1) + d 1.
In an actual software implementation, synchronization (sync) may be performed, for example, every 2s (sending a packet and waiting to receive an ack message), and a calibration (calibration) function is added. If d1 is greater than 5ms, the calculated d1 value is discarded, and the calculated d1 value is used. Therefore, the error of the delay statistics can be selected as d1 by setting a threshold value, e.g., 5ms, and d1 is discarded if it is greater than 5 ms. In practical tests, it is found that the error of d1 can be controlled within 3 ms.
After each step of updating the reference propagation delay is performed, the step of calculating the propagation delay of the subsequently received data packet using the updated reference propagation delay is continuously performed (e.g., steps 102 and 305). The reference transmission time delay can be updated at the receiving end, and the reference transmission time delay can also be updated at the sending end and then sent to the receiving end. The method can be adjusted according to the requirements of practical application.
In the method for acquiring data transmission delay of this embodiment, as long as the receiving end calculates the transmission delay of one data packet, the transmission delay of other subsequently received data packets can be calculated according to the sending and receiving timestamps. Compared with the previous mode that each data packet is transmitted back and forth to calculate the time delay, the algorithm described by the invention does not increase any system bandwidth load and does not wait for the acknowledgement message every time, so the calculation speed is high. Meanwhile, the receiving end can count the delay of the data packet after receiving the data packet, and the real-time performance is greatly improved.
Example 3
Fig. 6 is a block diagram illustrating an apparatus for acquiring a data transmission delay according to an embodiment of the present invention. As shown in fig. 6, the apparatus for acquiring data transmission delay mainly includes:
an obtaining module 61, configured to obtain a transmission delay of the first data packet as a reference transmission delay;
a calculating module 63, connected to the obtaining module 61, configured to calculate the transmission delay of the second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet, and the sending time and the receiving time of the second data packet;
wherein a transmission time of the first data packet is prior to a transmission time of the second data packet.
Specifically, referring to the derivation process of equation 1 in embodiment 1 and fig. 2, it can be seen that as long as the timestamp and the transmission delay of the data packet p1 transmitted for the first time are obtained, the transmission delay of other data packets pn (n >1) transmitted subsequently can be calculated. In the data transmission delay acquiring apparatus of this embodiment, after the acquiring module 61 acquires the transmission delay of the first data packet and determines the reference transmission delay, the calculating module 63 may calculate the transmission delay of the second data packet according to the reference transmission delay, the sending time and the receiving time of the first data packet, and the sending time and the receiving time of the second data packet. Specific implementation principles and examples can be found in the related description of embodiment 1.
Example 4
Fig. 7 is a block diagram illustrating an apparatus for acquiring a data transmission delay according to another embodiment of the present invention. The same components in fig. 7 and fig. 6 have the same meanings, and are not described in detail here.
The main difference from the previous embodiment is that the data transmission delay obtaining device of the present embodiment is preferably disposed on the receiving device side, and the obtaining module 61 of the device may include:
a first sending unit 611, configured to send a synchronous data packet, and record a sending timestamp for sending the synchronous data packet;
a first receiving unit 613, configured to record a receiving timestamp of a received acknowledgement message of the synchronization packet when the acknowledgement message is received, where the acknowledgement message is the first data packet;
a first calculating unit 615, connected to the first sending unit 611 and the first receiving unit 613, respectively, for calculating a round trip time of transmission according to a receiving timestamp of the acknowledgement message and a sending timestamp of the synchronization packet;
a second calculating unit 617, connected to the first calculating unit 615, configured to calculate the reference transmission delay according to the round trip time.
Specifically, the first sending unit 611 may send a synchronization packet to the sending device, and record a sending timestamp of sending the synchronization packet; after receiving the synchronization data packet, the sending device returns an acknowledgement message. When receiving the acknowledgement message (which may be regarded as a first data packet) of the synchronization data packet, the first receiving unit 613 may record a receiving timestamp of the acknowledgement message, and may further obtain a sending timestamp of the acknowledgement message sent by the sending end from the acknowledgement message. The first calculation unit 615 may calculate a round trip time from the transmission of the synchronization packet to the reception of the acknowledgement message, based on the reception time stamp of the acknowledgement message acquired from the first reception unit 613 and the transmission time stamp of the synchronization packet acquired from the first transmission unit 611. Then, the second calculation unit 617 may calculate the reference transmission delay time by dividing the round trip time by 2.
In one possible implementation, the calculation module 63 includes:
a second receiving unit 631, configured to, in a case that the second data packet is received, obtain, from the second data packet, a sending timestamp for sending the second data packet, and record a receiving timestamp for receiving the second data packet;
a third calculating unit 633, connected to the second receiving unit 631, the second calculating unit 617 and the first receiving unit 613 respectively, for acquiring a receiving time stamp and a transmitting time stamp of an acknowledgement message (first data packet) from the first receiving unit 613, acquiring a reference transmission delay from the second calculating unit 617, and acquiring a transmitting time stamp and a receiving time stamp of a second data packet from the second receiving unit 631, thereby calculating a transmission delay of the second data packet according to the reference transmission delay, the transmitting time stamp and the receiving time stamp of the first data packet, and the transmitting time stamp and the receiving time stamp of the second data packet.
In one possible implementation manner, the third calculating unit 633 calculates the transmission delay of the second data packet by using the following formula 1,
dn ═ t '-t1') - (tn-t1) + d1 formula 1,
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet. The derivation process of equation 1 can be referred to equations 2 to 4 and fig. 2.
In one possible implementation, the apparatus further includes: an update module 65, configured to resend the synchronization data packet once every time period set at intervals; and under the condition that the transmission delay calculated this time is smaller than a set threshold value, adopting the transmission delay calculated this time as the reference transmission delay.
In a possible implementation manner, the updating module 65 is further configured to, in a case that the calculated transmission delay of this time is greater than a set threshold, adopt the previously calculated transmission delay as the reference transmission delay. The specific principle of the update module can be seen in fig. 4 and its related description.
In the data transmission delay acquiring apparatus of this embodiment, as long as the acquiring module arranged at the receiving end calculates the transmission delay of one data packet, the calculating module can calculate the transmission delay of other subsequently received data packets according to the sending and receiving timestamps. Compared with the previous mode that each data packet is transmitted back and forth to calculate the time delay, the algorithm described by the invention does not increase any system bandwidth load and does not wait for the acknowledgement message every time, so the calculation speed is high. Meanwhile, the receiving end can count the delay of the data packet after receiving the data packet, and the real-time performance is greatly improved.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (8)
1. A method for obtaining data transmission delay is characterized by comprising the following steps:
acquiring a sending time stamp and a receiving time stamp of a first data packet and transmission delay of the first data packet, and determining the transmission delay as reference transmission delay;
the transmission delay of the first data packet is calculated according to round-trip time, and the round-trip time is calculated according to a receiving time stamp of the first data packet and a sending time stamp of a synchronous data packet;
under the condition of receiving a second data packet, acquiring a sending time stamp for sending the second data packet from the second data packet, and recording a receiving time stamp for receiving the second data packet;
calculating the transmission delay of the second data packet by adopting the following formula:
dn=(tn'-t1')-(tn-t1)+d1;
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet;
the second data packet is any data packet with the transmission time after the transmission time of the first data packet.
2. The method of claim 1, further comprising, prior to obtaining the transmission delay of the first packet:
sending the synchronous data packet, and recording a sending time stamp of the synchronous data packet;
and recording a receiving time stamp of the first data packet when the first data packet is received, wherein the first data packet is an acknowledgement message returned by responding to the synchronous data packet.
3. The method of claim 2, further comprising:
retransmitting the synchronous data packet once every time interval set time period;
and under the condition that the transmission delay of the first data packet calculated this time is smaller than a set threshold value, adopting the transmission delay of the first data packet calculated this time as the reference transmission delay.
4. The method of claim 3, further comprising:
and under the condition that the transmission delay calculated this time is greater than a set threshold, adopting the transmission delay calculated last time as the reference transmission delay.
5. An apparatus for obtaining data transmission delay, comprising:
an obtaining module, configured to obtain a sending timestamp and a receiving timestamp of a first data packet, and a transmission delay of the first data packet, and determine the transmission delay as a reference transmission delay;
the transmission delay of the first data packet is calculated according to round-trip time, and the round-trip time is calculated according to a receiving time stamp of the first data packet and a sending time stamp of a synchronous data packet;
the calculation module is connected with the acquisition module and comprises a second receiving unit and a third calculation unit;
the second receiving unit is configured to, when a second data packet is received, acquire a sending timestamp for sending the second data packet from the second data packet, and record a receiving timestamp for receiving the second data packet;
the third calculating unit is configured to calculate a transmission delay of the second data packet by using the following formula,
dn=(tn'-t1')-(tn-t1)+d1;
wherein t1 is the transmission timestamp of the first data packet, t1 'is the reception timestamp of the first data packet, tn is the transmission timestamp of the second data packet, tn' is the reception timestamp of the second data packet, d1 is the reference transmission delay, and dn is the transmission delay of the second data packet;
the second data packet is any data packet with the transmission time after the transmission time of the first data packet.
6. The apparatus of claim 5, wherein the obtaining module comprises:
the first sending unit is used for sending the synchronous data packet and recording a sending time stamp for sending the synchronous data packet;
a first receiving unit, configured to record a receiving timestamp of the first data packet when the first data packet is received, where the first data packet is an acknowledgement message returned in response to the synchronization data packet.
7. The apparatus of claim 6, further comprising:
the updating module is used for retransmitting the synchronous data packet once every time interval set time period; and under the condition that the transmission delay of the first data packet calculated this time is smaller than a set threshold value, adopting the transmission delay of the first data packet calculated this time as the reference transmission delay.
8. The apparatus of claim 7, wherein the updating module is further configured to adopt a previously calculated transmission delay as the reference transmission delay when the currently calculated transmission delay is greater than a set threshold.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610101530.4A CN105610652B (en) | 2016-02-24 | 2016-02-24 | Method and device for acquiring data transmission delay |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610101530.4A CN105610652B (en) | 2016-02-24 | 2016-02-24 | Method and device for acquiring data transmission delay |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105610652A CN105610652A (en) | 2016-05-25 |
CN105610652B true CN105610652B (en) | 2021-01-15 |
Family
ID=55990197
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610101530.4A Active CN105610652B (en) | 2016-02-24 | 2016-02-24 | Method and device for acquiring data transmission delay |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105610652B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108259364B (en) * | 2016-12-29 | 2021-09-14 | 中国移动通信集团浙江有限公司 | Network congestion determination method and device |
CN107196821A (en) * | 2017-05-24 | 2017-09-22 | 深圳市乃斯网络科技有限公司 | The method of calibration and system of time delay in network link |
WO2018214056A1 (en) * | 2017-05-24 | 2018-11-29 | 深圳市乃斯网络科技有限公司 | Method and system for verifying delay in network link |
CN109688059B (en) * | 2017-10-19 | 2022-02-01 | 深圳市中兴微电子技术有限公司 | Congestion management method and device for switching network and computer storage medium |
CN110366258B (en) * | 2018-04-09 | 2021-08-31 | 华为技术有限公司 | Data transmission method, related equipment and communication system |
CN110336713B (en) * | 2019-07-02 | 2021-07-13 | 中国联合网络通信集团有限公司 | A method and terminal device for detecting end-to-end delay and rate of cellular Internet of Things |
CN113132041B (en) * | 2019-12-31 | 2022-03-04 | 中移(成都)信息通信科技有限公司 | Data transmission delay calculation method and device |
CN115038109A (en) * | 2021-02-20 | 2022-09-09 | 中国移动通信有限公司研究院 | Time delay measuring method and equipment |
CN117294832B (en) * | 2023-11-22 | 2024-03-26 | 湖北星纪魅族集团有限公司 | Data processing method, device, electronic equipment and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933429A (en) * | 2005-09-12 | 2007-03-21 | 华为技术有限公司 | Time delay characteristic measuring method in data communication network |
CN101534222A (en) * | 2008-03-10 | 2009-09-16 | 中国移动通信集团公司 | End-to-end network delay jitter measuring method, device and system thereof |
CN102227110A (en) * | 2011-06-17 | 2011-10-26 | 华为技术有限公司 | Measurement one way delay method and equipment thereof, and communication system |
-
2016
- 2016-02-24 CN CN201610101530.4A patent/CN105610652B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1933429A (en) * | 2005-09-12 | 2007-03-21 | 华为技术有限公司 | Time delay characteristic measuring method in data communication network |
CN101534222A (en) * | 2008-03-10 | 2009-09-16 | 中国移动通信集团公司 | End-to-end network delay jitter measuring method, device and system thereof |
CN102227110A (en) * | 2011-06-17 | 2011-10-26 | 华为技术有限公司 | Measurement one way delay method and equipment thereof, and communication system |
Also Published As
Publication number | Publication date |
---|---|
CN105610652A (en) | 2016-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105610652B (en) | Method and device for acquiring data transmission delay | |
CN106488550B (en) | Determine the method and apparatus of terminal Yu base station clock time deviation | |
US8335173B2 (en) | Inserting time of departure information in frames to support multi-channel location techniques | |
CN101364863B (en) | Time synchronizing method, apparatus and system for master, slave time clock side in synchronous network | |
KR101481396B1 (en) | Method for synchronizing master and slave clocks of packet-switched network with aggregated connections between nodes, and associated synchronization devices | |
CN107508719B (en) | Method and device for measuring network time delay and network node | |
US20160301589A1 (en) | Methods, systems, and computer readable media for one-way link delay measurement | |
US20040093435A1 (en) | Method for synchronizing a first clock to a second clock, processing unit and synchronization system | |
CN103563287B (en) | Synchronization device and synchronization method | |
WO2013099026A1 (en) | Node device and time synchronization method | |
KR101290643B1 (en) | Method and system for bearing time synchronization protocol in optical transport network | |
US9042411B1 (en) | System and method for accurate time sampling in presence of output delay | |
EP3720053B1 (en) | Flexible ethernet delay measurement method and related device | |
US8149880B1 (en) | Media streaming synchronization | |
CN109818702A (en) | A system and method for realizing IEEE802.1AS clock synchronization function | |
WO2019127447A1 (en) | Method, apparatus and system for time synchronization | |
EP3935764B1 (en) | Network entities and methods for a wireless network system for determining time information | |
JP2013121014A (en) | Time synchronization device and method | |
EP3425969B1 (en) | Synchronization information sending or receiving method, base station, and communication node | |
US20230328675A1 (en) | Transmission Management | |
CN103546273B (en) | Frequency synchronism device and method based on PTP frames | |
US20120117272A1 (en) | Apparatus and method for synchronizing wireless devices | |
EP2106052A2 (en) | Communication system, transmitting apparatus, receiving apparatus, communication method and record medium for transferring a clock in a packet network | |
US11343007B2 (en) | Time synchronization method and device | |
US9749210B2 (en) | Method for measuring network throughput |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |