CN106452972B - Method and device for obtaining delay time of data packet - Google Patents

Method and device for obtaining delay time of data packet Download PDF

Info

Publication number
CN106452972B
CN106452972B CN201610972234.1A CN201610972234A CN106452972B CN 106452972 B CN106452972 B CN 106452972B CN 201610972234 A CN201610972234 A CN 201610972234A CN 106452972 B CN106452972 B CN 106452972B
Authority
CN
China
Prior art keywords
data packet
module
hash value
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
Application number
CN201610972234.1A
Other languages
Chinese (zh)
Other versions
CN106452972A (en
Inventor
王继良
曹志超
刘云浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201610972234.1A priority Critical patent/CN106452972B/en
Publication of CN106452972A publication Critical patent/CN106452972A/en
Application granted granted Critical
Publication of CN106452972B publication Critical patent/CN106452972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0852Delays

Landscapes

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

Abstract

The invention provides a method and a device for obtaining delay time of a data packet, wherein the method comprises the following steps: the sending end sends the first combined hash value of the sent data packet and the compression timestamp corresponding to the data packet to the receiving end; the receiving end receives and recovers the compression time stamp, and a second combined hash value of the received data packet is calculated according to the received data packet; and when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time of the data packet based on the sending time stamp and the receiving time stamp. The invention improves the measurement efficiency of the data packet delay time.

Description

Method and device for obtaining delay time of data packet
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for obtaining a packet delay time.
Background
Packet delay is an important attribute of a packet and is an important parameter in network design, analysis, research and practical applications. Packet delay is related to the performance of the actual system, reflecting possible abnormal conditions in the network, so in the actual network, packet delay measurement is a very important problem, for example, in the internet and packet center network, packet delay is directly related to the performance and service quality of the network. Among the conventional methods, the simplest method of packet delay measurement is to transmit time stamp information from a sender to a receiver. More specifically, a transmission time stamp is added to each packet at the time of transmission, and a reception time stamp is added to each packet at the time of reception, and the delay of each packet is calculated from these two time stamps. Assume that the time stamp of transmission is t1 and the time stamp of receipt of the packet is t2, so that the delay of the entire packet is t2-t 1. The measurement method requires that a timestamp is added to each data packet, so that great extra overhead is brought, the method cannot be applied to a network with large-scale data packets, and meanwhile, under many conditions, the measurement method cannot change the data packets, so that the timestamps cannot be added to the data packets, and the failure of the data packet delay measurement method is also caused.
Disclosure of Invention
The present invention provides a method and apparatus for obtaining a packet delay time that overcomes, or at least partially solves, the above-mentioned problems.
According to an aspect of the present invention, there is provided a method for obtaining a packet delay time, including:
s1, the sending end sends the first combined hash value of the sent data packet and the compression time stamp corresponding to the data packet to the receiving end;
s2, the receiving end receives and recovers the compressed timestamp, and a second combined hash value of the received data packet is calculated according to the received data packet; and
and S3, when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time of the data packet based on the sending time stamp and the receiving time stamp.
According to another aspect of the present invention, there is provided a transmitting end, including:
the first sending module is used for continuously sending data packets to the receiving end;
the sending time module is connected with the first sending module and used for saving the sending time of each data packet as a corresponding sending time stamp;
the compression time module is connected with the sending time module and is used for compressing all the sending time stamps to obtain a compression time stamp;
the first operation module is connected with the sending module and obtains a corresponding first hash value for each sent data packet based on a first hash algorithm;
the second operation module is connected with the first operation module, performs connection operation on all the first hash values, and obtains a first combined hash value based on a second hash algorithm; and
and the second sending module is connected with the first operation module and the second operation module and sends the first combined hash value and the compression timestamp to a receiving end.
According to another aspect of the present invention, there is provided a receiving end, including:
the first receiving module is used for continuously receiving data packets from the receiving end;
the receiving time module is connected with the first receiving module and used for saving the time of each data packet reaching a receiving end as a corresponding receiving time stamp;
the decompression time module is used for receiving and decompressing the compression time stamp to obtain the sending time stamp of each data packet;
the third operation module is connected with the first receiving module and obtains a corresponding second hash value for each sent data packet based on the first hash algorithm;
the fourth operation module is connected with the third operation module, performs connection operation on all the second hash values, and obtains a second combined hash value based on the second hash algorithm;
a second receiving module that receives the first combined hash value; and
and the delay judging module is connected with the second receiving module, the fourth operation module, the receiving time module and the decompression time module, and when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time of the data packet based on the sending time stamp and the receiving time stamp.
The application provides a method and equipment for obtaining delay time of a data packet, a combined hash value is obtained by compressing timestamps of the sent data packets in a centralized manner and passing all the data packets through a hash algorithm, so that the transmission times of attributes related to the transmission delay of the data packets are greatly reduced, the measurement efficiency is greatly improved, the accuracy in transmission delay measurement is ensured, the calculation errors caused by the loss and disorder of the data packets are prevented, and the delay measurement can be applied to a network of high-speed large-scale data packets.
Drawings
FIG. 1 is a schematic overview of a process according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
Fig. 1 shows a general flow diagram of an embodiment of the invention. In the data packet transmission system, a sending end sends a plurality of data packets to a receiving end within a certain time, the sending end sends data to locally generate a sending time stamp corresponding to the sending time of the data packets, and the receiving end locally generates a receiving time stamp corresponding to the receiving time of the data packets when receiving the data. In summary, the method for obtaining the delay time of the data packet of the present invention comprises: the sending end calculates the hash value h of each data based on a hash function, then a combined hash value CH is obtained based on all hash values, meanwhile, the sending end compresses sending time stamps of all data to obtain a compression time stamp T, the sending end sends the combined hash value CH and the compression time stamp T to the receiving end, the receiving end firstly decompresses the compression time stamp T to obtain sending time stamps of all sent data, then the hash values h 'of all received data are calculated, similarly, the combined hash value CH' is obtained for all hash values h ', when the combined hash value CH is the same as the combined hash value CH', the data packet received by the receiving end is completely consistent with the data packet sent by the sending end, and then the delay time of each data packet can be obtained by comparing the receiving time stamp with the sending time stamp.
In a specific embodiment, in the invention, a sending end sends n data packets to a receiving end within a certain time, and the n data packets are d respectively1、d2、…、dn
In a specific embodiment, the sending end calculates hash values of n data packets, and the hash values may be calculated by using an existing hash algorithm, for example, md5, and the hash values of the n data packets are obtained by calculation and are h respectively1,h2,…,hnI.e. hi=H(di) Where H is a given hash algorithm, HiIs the calculated hash value.
In a specific embodiment, the sending end calculates the first combined hash value CH, and the calculation method of the first combined hash value is based on the hash value of each data packet.
The calculation formula of the first combined hash value CH is: CH ═ H (H)1++h2++h3++…++hn);
H is a given hash algorithm, and a + symbol is a connection symbol of a character string, so that n hash values are connected, the number of the hash values is greatly reduced in the step, and the number of the hash values is reduced from n to 1.
In a specific embodiment, a sending end compresses time stamps of all sent data packets to obtain a compressed time stamp; the timestamp of the sending end in sending the ith data packet is tiBy making a pair t1、t2、…、tnThe compression of the hash value is carried out to obtain a compression time stamp T, and the sending end sends the compression time stamp T and the combined hash value CH to the receiving end.
In a specific embodiment, after receiving the compression timestamp T, the receiving end decompresses T to obtain the transmission timestamps of n data packets, where the decompressed timestamp is s1、S2、…、Sn
In one embodiment, the receiving end receives m data packets (d'1,d′2…,d′m) While calculating the hash value d 'of each data packet'i=H(d′i) And simultaneously calculating the hash value d 'of each received data packet'iCalculating a combined hash value of the received packets, where the combined hash value is CH '═ H (H'1++h′2++…++h′m)。
In one embodiment, after the receiving end receives the combined hash value CH, the receiving end compares CH with CH'. The combined hash value has an important characteristic, when the data packet received by the receiving end is completely consistent with the data packet sent by the sending end, the combined hash value calculated by the receiving end is consistent with the combined hash value calculated by the sending end; on the contrary, when the data packet received by the receiving end is inconsistent with the data packet sent by the sending end, the combined hash value calculated by the receiving end should be inconsistent with the combined hash value calculated by the sending end. Therefore, by comparing the combined hash value, whether the data packet is lost, out of order and the like in the sending process can be judged, and meanwhile, a foundation is laid for the time delay measurement of the next large-scale data packet. If CH and CH' are equal, the delay/of each packet is calculatedi=ri-siWherein l isiIndicating the delay time of the ith packet.
The application provides a method and a system for obtaining delay time of a data packet, which greatly reduce the transmission times of attributes related to the transmission delay of the data packet, ensure the accuracy in transmission delay measurement and greatly improve the measurement efficiency by compressing the timestamp of the sent data packet in a centralized manner and obtaining a combined hash value of all data packets through a hash algorithm, so that the delay measurement can be applied to a network of high-speed large-scale data packets.
The hash function used in the present invention may be any known hash function.
In one embodiment, the time stamp is compressed by a wavelet compression method, which has two advantages: the sum of the first, all recovered timestamp errors is close to 0. The calculated average delay is very close to the true average. Second, errors are evenly distributed and small, so burst and anomalous delays can be captured even if timestamp errors occur.
In a specific embodiment, the present invention further provides a transmitting end, including:
a first sending module for continuously sending n data packets to a receiving end, wherein the n data packets are d1、d2、…、dn
A sending time module connected with the first sending module and used for saving the sending time of each data packet as a corresponding sending time stamp, wherein the time stamp of the ith data packet is ti,;
The compression time module is connected with the sending time module and is used for compressing all the sending time stamps to obtain a compression time stamp T;
a first operation module connected with the sending module and used for obtaining a corresponding first hash value h for each sent data packet based on a first hash algorithmi=H(di) Where H is a given first hash algorithm, HiIs the calculated hash value;
a second operation module connected with the first operation module for performing connection operation on all the first Hash values and obtaining one Hash value based on a second Hash algorithmThe calculation formula of the first combined hash value CH is: CH ═ H (H)1++h2++h3++…++hn) H is a given second hash algorithm, a + symbol is a connection symbol of a character string, and n hash values are connected, so that the number of the hash values is greatly reduced, and the number of the hash values is reduced from n to 1; and
and the second sending module is connected with the first operation module and the second operation module and sends the first combined hash value CH and the compression timestamp T to a receiving end.
In an embodiment, the present invention further provides a receiving end, including:
a first receiving module for continuously receiving m data packets, i.e. d'1,d′2,…,d′m
The receiving time module is connected with the first receiving module, and saves the time of each data packet reaching a receiving end as a corresponding receiving time stamp ri;
a decompression time module for receiving and decompressing the compression time stamp T to obtain the sending time stamp of each data packet, the decompressed time stamp is expressed as s1、s2、…、sn
A third operation module, connected to the first receiving module, for obtaining a corresponding second hash value, i.e. d ', for each received data packet based on the first hash algorithm'i=H(d′i),di' as the second hash value of the received ith data packet, the hash algorithm used in the step is consistent with the hash algorithm adopted by the first operation module, so that the obtained hash values can be ensured to be consistent.
A fourth operation module, connected to the third operation module, for performing a connection operation on all the second hash values CH ', and obtaining a second combined hash value CH', that is, CH '═ H (H'1++h′2++…++h′m) H is a second hash algorithm;
a second receiving module that receives the first combined hash value; and
a delay judging module connected with the second receiving module, the fourth operation module, the receiving time module and the decompressing time module, when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time l of the data packet based on the sending time stamp and the receiving time stampi=ri-siWherein l isiIndicating the delay time of the ith packet.
In a specific embodiment, the delay determination module calculates a difference between a receiving timestamp and a sending timestamp of a data packet to obtain the delay time of the data packet.
Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A method for obtaining a packet delay time, comprising:
s1, the sending end sends the first combined hash value of the sent data packet and the compression time stamp corresponding to the data packet to the receiving end;
s2, the receiving end receives and recovers the compressed timestamp, and a second combined hash value of the received data packet is calculated according to the received data packet; and
s3, when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time of the data packet based on the sending time stamp and the receiving time stamp;
wherein the step S1 includes:
s1.1, a sending end obtains a hash value of each data packet;
s1.2, acquiring the first combined hash value based on the hash values of all the data packets;
the step S1.2 comprises: the hash values of the n data sent are h respectively1、h2、….、hmThe first combined hash value CH ═ H (H)1++h2++h3++…++hm) Where H is a given hash function and the + symbol is the concatenation symbol of the string.
2. The method for obtaining the packet delay time according to claim 1, wherein the step S2 includes:
s2.1, the receiving end obtains the hash value of each data packet;
s2.2, acquiring the second combined hash value based on the hash values of all the data packets.
3. The method for obtaining the delay time of the data packet according to claim 2, wherein the step S2.2 comprises: the hash values of the received m data packets are h respectively1’、h2’、….、hn', the second combined hash value CH' ═ H (H)1’++h2’++h3’++…++hn') where H is the same hash function as in said step S1.2 and the + sign is the connection sign of the string.
4. The method for obtaining the packet delay time according to claim 3, wherein the step S1 further comprises:
s1.3, the sending end takes the sending time of each data packet as a corresponding sending time stamp to be stored locally;
s1.4, the sending end compresses all the sending time stamps to obtain a compression time stamp.
5. The method for obtaining the packet delay time according to claim 4, wherein the step S3 includes:
s3.1, the receiving end takes the time of each data packet arriving at the receiving end as a corresponding receiving time stamp to be stored locally;
and S3.2, when the first combined hash value is equal to the second combined hash value, calculating the difference value between the receiving time stamp and the sending time stamp of the data packet to obtain the delay time of the data packet.
6. A transmitting end, comprising:
the first sending module is used for continuously sending data packets to the receiving end;
the sending time module is connected with the first sending module and used for saving the sending time of each data packet as a corresponding sending time stamp;
the compression time module is connected with the sending time module and is used for compressing all the sending time stamps to obtain a compression time stamp;
the first operation module is connected with the sending module and obtains a corresponding first hash value for each sent data packet based on a first hash algorithm;
the second operation module is connected with the first operation module, performs connection operation on all the first hash values, and obtains a first combined hash value based on a second hash algorithm; and
the second sending module is connected with the first operation module and the second operation module and sends the first combined hash value and the compression timestamp to a receiving end;
the second operation module is specifically configured to: the hash values of the n data sent are h respectively1、h2、….、hmThe first combined hash value CH ═ H (H)1++h2++h3++…++hm) Where H is a given hash function and the + symbol is the concatenation symbol of the string.
7. A receiving end, comprising:
the first receiving module is used for continuously receiving data packets from the receiving end;
the receiving time module is connected with the first receiving module and used for saving the time of each data packet reaching a receiving end as a corresponding receiving time stamp;
the decompression time module is used for receiving and decompressing the compression time stamp to obtain the sending time stamp of each data packet;
the third operation module is connected with the first receiving module and obtains a corresponding second hash value for each sent data packet based on the first hash algorithm;
the fourth operation module is connected with the third operation module, performs connection operation on all the second hash values, and obtains a second combined hash value based on the second hash algorithm;
a second receiving module that receives the first combined hash value; and
the delay judging module is connected with the second receiving module, the fourth operation module, the receiving time module and the decompression time module, and when the first combined hash value is equal to the second combined hash value, the receiving end obtains the delay time of the data packet based on the sending time stamp and the receiving time stamp;
the fourth operation module is specifically configured to: the hash values of the received m data packets are h respectively1’、h2’、….、hn', the second combined hash value CH' ═ H (H)1’++h2’++h3’++…++hn') where H is the same hash function as in step S1.2 and the + sign is the connection sign of the string.
8. The receiving end according to claim 7, wherein the delay judging module calculates a difference between a receiving time stamp and a sending time stamp of the data packet to obtain the delay time of the data packet.
CN201610972234.1A 2016-10-31 2016-10-31 Method and device for obtaining delay time of data packet Active CN106452972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610972234.1A CN106452972B (en) 2016-10-31 2016-10-31 Method and device for obtaining delay time of data packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610972234.1A CN106452972B (en) 2016-10-31 2016-10-31 Method and device for obtaining delay time of data packet

Publications (2)

Publication Number Publication Date
CN106452972A CN106452972A (en) 2017-02-22
CN106452972B true CN106452972B (en) 2019-12-20

Family

ID=58180072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610972234.1A Active CN106452972B (en) 2016-10-31 2016-10-31 Method and device for obtaining delay time of data packet

Country Status (1)

Country Link
CN (1) CN106452972B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038048A (en) * 2017-12-05 2018-05-15 郑州云海信息技术有限公司 Statistical method, device and the readable storage medium storing program for executing that individual data pack receiving and transmitting takes
CN109542059B (en) * 2018-11-19 2022-04-01 国核自仪系统工程有限公司 Historical data compression device and method
CN112134747A (en) * 2019-06-24 2020-12-25 中兴通讯股份有限公司 Method for detecting transmission delay and related equipment
CN112398704B (en) * 2019-08-15 2022-12-23 中国移动通信集团广东有限公司 Virtual network delay calculation method and terminal equipment
CN114726803B (en) * 2021-01-05 2023-06-30 大唐移动通信设备有限公司 Method, communication device, apparatus and storage medium for measuring and feeding back delay information
CN114293846A (en) * 2021-11-16 2022-04-08 武汉小安科技有限公司 Unlocking control method and device for battery compartment lock, electronic equipment and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA2912352A1 (en) * 2012-05-18 2013-11-21 Clarisite Ltd Method and apparatus for storing network data
CN102930185B (en) * 2012-11-28 2015-07-29 中国人民解放军国防科学技术大学 The integrity verification method of program security-critical data and device during operation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Every Packet Counts: Fine-Grained Delay and Loss Measurement with Reordering";王继良等;《2014 IEEE 22nd International Conference on Network Protocols》;20141024;第98页第IV第1行-第V节最后1行 *

Also Published As

Publication number Publication date
CN106452972A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN106452972B (en) Method and device for obtaining delay time of data packet
US11223669B2 (en) In-service quality monitoring system with intelligent retransmission and interpolation
CN1938972B (en) Methods and apparatuses for measuring transmission quality of multimedia data
WO2015165384A2 (en) System and method for hierarchical compression
US20150295807A1 (en) Manipulation of streams of monitoring data
US8654858B2 (en) Methods and apparatus for differential encoding
JP6389280B2 (en) Protocol stack conforming method and apparatus
CN104135452A (en) Synchronous compression and recovery algorithm and device for IQ (Intelligence Quotient) data
CN101174995A (en) Method and system for monitoring multimedia service performance
US20200193999A1 (en) Handling of poor audio quality in a terminal device
Abualhaj et al. Effective Voice Frame Pruning Method to Increase VoIP Call Capacity.
CN101651838A (en) Method, system and device for transmitting video data
Atayero et al. Modeling, simulation and analysis of video streaming errors in wireless wideband access networks
CN112335203A (en) Processing local area network diagnostic data
KR20080080521A (en) Feedback and frame synchronization between media encoders and decoders
CN102821489A (en) Base station and data compression method on base station side
CN114363419A (en) Transmission method, equipment and storage medium based on NETCONF protocol
CN116527454A (en) Channel estimation method and device based on speech pilot frequency
KR101634822B1 (en) Adapter for synchronizing data over different networks
CN103067971A (en) TCP (transmission control protocol) header compression method in wireless IPv6 (internet protocol version 6) network
CN102082726B (en) Data processing method, device and transmission system
US20070127433A1 (en) Method and apparatus for generating sndcp header in gprs communication system
WO2023232116A1 (en) Uplink and downlink synchronization method and apparatus for mobile satellite communication system
CN117278439B (en) Communication quick verification method based on compression algorithm
CN118316983A (en) Intelligent electromagnetic water meter data conversion calculation scheme with edge calculation function applied to partition metering

Legal Events

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