Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
METHOD AND SYSTEM FOR ESTIMATING COMMUNICATION LATENCY
Document Type and Number:
WIPO Patent Application WO/2021/159005
Kind Code:
A1
Abstract:
A method is described for measuring a communication latency between a first device with a first local clock and a second device with a second local clock, the devices interconnected for digital communication to a network, comprising sending an upstream communication and a downstream communication between the devices, and measuring using said local clocks an upstream send time (τ 1 ), an upstream receive time (τ 2 ), a downstream send time (τ 3 ) and a downstream receive time (τ 4 ); calculating a first measured delay (y 1 ) as τ 2 - τ 1 and calculating a second measured delay (y2) as τ 4 - τ 3 ; providing said measured delays (y 1 , y 2 ) to a recursive filter function arranged to estimate a first latency (d 1 ) and a second latency (d 2 ) based on said measured delays (y 1 , y 2 ) and on values for the first and second latencies (d 1 , d 2 ) previously estimated by said recursive filter function, and iterating. The invention also relates to a system and computer software product.

Inventors:
BERGSTEN ANDERS (US)
JOHANSSON ANDREAS (US)
Application Number:
PCT/US2021/016936
Publication Date:
August 12, 2021
Filing Date:
February 05, 2021
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
JUNIPER NETWORKS INC (US)
International Classes:
H04L12/26; H04J3/06; H04L12/24
Foreign References:
EP1936867A12008-06-25
US20150281028A12015-10-01
US20070217343A12007-09-20
CN108683472A2018-10-19
SE2050133A2020-02-07
Other References:
HAN LIN ET AL: "Minimum Control Latency of SDN Controller Placement", 2016 IEEE TRUSTCOM/BIGDATASE/ISPA, IEEE, 23 August 2016 (2016-08-23), pages 2175 - 2180, XP033063595, DOI: 10.1109/TRUSTCOM.2016.0334
Attorney, Agent or Firm:
ROGERS, Jennifer M.K. et al. (US)
Download PDF:
Claims:
CLAIMS

What is claimed is:

1. A method for measuring a communication latency between a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both con nected for digital communication to a digital communication network, wherein the method comprises the steps: a) sending a first communication from the first device to the second device, measuring a first communication send time (TJJ using the first clock and measuring a first commu nication receive time (t2) using the second clock; b) sending a second communication from the second device to the first device, measuring a second communication send time (t3) using the second clock and measuring a second communication receive time (t4) using the first clock; c) calculating a first measured delay (y 4) as the difference between the first communica tion receive time (t2) and the first communication send time (TJJ and calculating a second measured delay (y2) as the difference between the second communication re ceive time (t4) and the second communication send time (t3); d) providing said first measured delay (y^ and said second measured delay (y2) to a re cursive filter function arranged to estimate a first latency (d4) and a second latency (d2) based on said first measured delay (y4), said second measured delay (y2), a value for the first latency (d4) previously estimated by said recursive filter function and a value for the second latency (d2) previously estimated by said recursive filter function, and e) iterating from step a.

2. The method according to claim 1, wherein the recursive filter function is arranged to assume that a difference ( d ) between the first latency (d4) and the second latency (d2) is constant over steps a) and b) of one single iteration of the method.

3. The method according to claim 1 or 2, wherein the recursive filter function is arranged to assume that a difference ( d ) between the first latency (d^ and the second latency (d2) decreases across iterations, or is zero, possibly apart from a random term.

4. The method according to any one of the preceding claims, wherein the recursive filter function is arranged to assume that a time offset ( 0 ) between the first clock and the second clock is constant over steps a) and b) of one single iteration of the method.

5. The method according to any one of the preceding claims, wherein the recursive filter function is arranged to assume that the second clock is associated with a constant or variable offset drift (T) in relation to the first clock.

6. The method according to any one of the preceding claims, wherein the recursive filter function comprises a Kalman filter used in said estimations performed in step d).

7. The method according to claim 6, wherein the method further comprises determining a residual value with respect to said estimated first (dj and/or second (d2) latency, or with respect to a sum of the estimated first (¾) and second ( d2 ) latencies.

8. The method according to any one of the preceding claims, wherein the method further comprises the step of calculating an estimated current second clock offset ( 0 ) and drift (G), in relation to the first clock, based on the estimated first (d^ and second (d2) latencies.

9. The method according to any one of the preceding claims, wherein steps a)-c) are iter ated over a predetermined sampling period, and wherein step d) is thereafter performed using the shortest first measured delay as the first measured delay (y- and the shortest second measured delay as the second measured delay (y2), or alternatively using the first and second measured delay from the step c) iteration associated with the smallest sum of first and second measured delays as the first (y c) and second (y2) measured delays.

10. The method according to claim 9, wherein in step d) a sample timestamp is provided to the recursive filter function, which sample timestamp is determined in relation to the pre determined sampling period rather than in relation to the measurement time of the first (y- or second (y2) measured delays provided to the recursive filter function.

11. The method according to claim 9 or 10, wherein during said predetermined sampling period steps a)-c) are iterated at least ten times.

12. The method according to any one of the preceding claims, wherein the first and second communications each comprises information unrelated to the estimation of the first ( d 4) and second ( d2 ) latency.

13. The method for synchronizing a first local clock of a first device in relation to a second local clock of a second device, which first and second devices are both connected for digital communication to a digital communication network, wherein the method comprises perform ing steps a)-e) according to any one of the preceding claims, in that the method further com prises, in step d), the recursive filter function determining a relative time offset ( 0 ) between the first clock and the second clock as well as a relative offset time drift ( T ) between the first clock and the second clock, and in that the method further comprises the step of synchroniz ing said first and second clocks based on said relative time offset ( 0 ) and relative time offset drift (T).

14. A system for measuring a communication latency between a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both con nected for digital communication to a digital communication network, which system com prises a recursive filter means, wherein the system is arranged to, iteratively: receive or record a measurement of a first communication send time (TJJ measured using the first clock and a first communication receive time (t2) measured using the second clock, which measurements are made in relation to a first communication sent from the first device to the second device; receive or record a measurement of a second communication send time (t3) measured using the second clock and a second communication receive time (t4) measured using the first clock, which measurements are made in relation to a second communication sent from the second device to the first device; calculate a first measured delay ( y 4) as the difference between the first communica tion receive time (t2) and the first communication send time (t-j , and calculate a second measured delay (y2) as the difference between the second communication receive time (t4) and the second communication send time (t3); and estimate, using the recursive filter means, a first latency (d4) and a second latency (d2) based on said first measured delay (y4), said second measured delay (y2), a value for the first latency (¾) previously estimated by said recursive filter means and a value for the sec ond latency ( d2 ) previously estimated by said recursive filter means.

15. A computer software product for measuring a communication latency between a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both connected for digital communication to a digital communication network, which computer software product is arranged to, when executed on one or several computer processors, perform the steps: a) receiving or recording a measurement of a first communication send time (TJJ meas ured using the first clock and a first communication receive time (t2) measured using the second clock, which measurements are made in relation to a first communication sent from the first device to the second device; b) receiving or recording a measurement of a second communication send time (t3) meas ured using the second clock and a second communication receive time (t4) measured using the first clock, which measurements are made in relation to a second communi cation sent from the second device to the first device; c) calculating a first measured delay (y 4) as the difference between the first communica tion receive time (t2) and the first communication send time (t-,3, and calculating a second measured delay (y2 ) as the difference between the second communication re ceive time (t4) and the second communication send time (t3); d) estimating, using a recursive filter function, a first latency (¾) and a second latency (d2) based on said first measured delay (y4), said second measured delay (y2), a value for the first latency (d4) previously estimated by said recursive filter function and a value for the second latency (d2) previously estimated by said recursive filter function; and e) iterating from step a.

Description:
METHOD AND SYSTEM FOR ESTIMATING COMMUNICATION LATENCY

[0001] This application claims the benefit of SE Application No. 2050133-4 filed February 7, 2020, the entire content of which is herein incorporated by reference.

TECHNICAL FIELD

[0002] The present invention relates to a method, a system and a computer software product for estimating communication latency, in particular communication latency between a first and a second network-connected communication device each having their respective inde pendent device clock.

BACKGROUND

[0003] The present invention is applicable in the field of monitoring, maintenance and oper ation of digital communication networks, such as the internet.

[0004] In such networks, connected devices communicate with each other. In such commu nications, there are inevitably latencies. Such latencies occur bidirectionally, in other words for any particular roundtrip communication between two connected devices there are two latency delays involved.

[0005] In many situations, it is important to be able to accurately estimate these latencies. For instance, it may be desirable for an automatic monitoring system to be able to receive an early warning that a communication latency between two particular connected devices has increased, to be able to quickly take appropriate action. In other examples, accurate latency information constitutes useful input when planning and/or developing network designs or implementing networked system solutions, since such latencies may affect performance in various ways that need to be considered to be able to reach satisfying performance.

[0006] It may also be desirable to synchronise the respective local clock of two devices, for improved interoperability or specific network based tasks requiring accurate time synchroni sation.

[0007] There are various known ways of measuring communication latencies, normally using dedicated probing messages sent between the connected devices in question. This introduces additional network traffic, which is not desirable.

[0008] Normally, each connected device has its own internal system clock, which is gener ally not synchronised across connected devices. In other words, each device has no way of knowing whether the system clock of a different device has an accurate, or the same, sense of the current time. This complicates the process of measuring communication latency be tween such connected devices.

[0009] Furthermore, communication latencies between different connected devices typically change and fluctuate over time, not only due to different properties of the various system clocks of devices but also due to the nature of the communication network. For instance, communication paths will normally involve additional connected devices in unpredictable ways, and communications may be rerouted to different paths without notice and outside of the control of operators of the devices in question. In addition, overall network load may fluctuate over time.

SUMMARY

[0010] Hence, it would be desirable to be able to achieve an accurate measurement of a cur rent communication latency between a pair of network connected devices, both upstream and downstream, that provides reliable measurement results under said unpredictable and chang ing network and communication conditions.

[0011] The present invention solves the above-described problems.

[0012] Hence, the invention relates to a method for measuring a communication latency be tween a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both connected for digital communication to a digital communication network, wherein the method comprises the steps a) sending a first communication from the first device to the second device, measuring a first communication send time using the first clock and measuring a first communication receive time using the second clock; b) sending a second communication from the second device to the first device, measuring a second com munication send time using the second clock and measuring a second communication receive time using the first clock; c) calculating a first measured delay as the difference between the first communication receive time and the first communication send time and calculating a second measured delay as the difference between the second communication receive time and the second communication send time; d) providing said first measured delay and said second measured delay to a recursive filter function arranged to estimate a first latency and a second latency based on said first measured delay, said second measured delay, a value for the first latency previously estimated by said recursive filter function and a value for the second latency previously estimated by said recursive filter function, and e) iterating from step a. [0013] Furthermore, the present invention relates to a system for measuring a communication latency between a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both connected for digital communication to a digital communication network, which system comprises a recursive filter means, wherein the sys tem is arranged to, iteratively receive or record a measurement of a first communication send time measured using the first clock and a first communication receive time measured using the second clock, which measurements are made in relation to a first communication sent from the first device to the second device; receive or record a measurement of a second com munication send time measured using the second clock and a second communication receive time measured using the first clock, which measurements are made in relation to a second communication sent from the second device to the first device; calculate a first measured delay as the difference between the first communication receive time and the first communi cation send time, and calculate a second measured delay as the difference between the second communication receive time and the second communication send time; and estimate, using the recursive filter means, a first latency and a second latency based on said first measured delay, said second measured delay, a value for the first latency previously estimated by said recursive filter means and a value for the second latency previously estimated by said recur sive filter means.

[0014] Moreover, the present invention relates to a computer software product for measuring a communication latency between a first and a second device, which first device has a first clock being local to the first device, which second device has a second clock being local to the second device, which first and second devices are both connected for digital communi cation to a digital communication network, which computer software product is arranged to, when executed on one or several computer processors, perform the steps a) receiving or re cording a measurement of a first communication send time measured using the first clock and a first communication receive time measured using the second clock, which measure ments are made in relation to a first communication sent from the first device to the second device; b) receiving or recording a measurement of a second communication send time meas ured using the second clock and a second communication receive time measured using the first clock, which measurements are made in relation to a second communication sent from the second device to the first device; c) calculating a first measured delay as the difference between the first communication receive time and the first communication send time, and calculating a second measured delay as the difference between the second communication receive time and the second communication send time; d) estimating, using a recursive filter function, a first latency and a second latency based on said first measured delay, said second measured delay, a value for the first latency previously estimated by said recursive filter function and a value for the second latency previously estimated by said recursive filter func tion; and e) iterating from step a.

[0015] In the following, the invention will be described in detail, with reference to exempli fying embodiments of the invention and to the enclosed drawings.

BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 illustrates a system according to the present invention, suitable for perform ing a method according to the present invention;

[0017] Figure 2 illustrates a measurement performed in accordance with a method according to the present invention; and

[0018] Figure 3 is a flowchart illustrating a method according to the present invention.

DETAILED DESCRIPTION

[0019] Figure 1 illustrates a system 100 according to the present invention, for measuring a communication latency between a first 110 and a second 120 device.

[0020] The first 110 and second 120 devices are both connected to a digital communication network 10 for digital communication between said devices 110, 120. The network 10 may be the internet, but may also be a local network, such as a virtual or physical private network or any well-defined subpart of the internet. Each of the devices 110, 120 may be a respective hardware device, which in itself may be standalone or distributed, as the case may be. How ever, it is preferred that both the first 110 and second 120 device are arranged with at least one respective well-defined port 113; 123 for inbound communications and at least one well- defined port 112; 122 for outbound communications. For both devices 110, 120 its inbound port 113; 123 may be the same as the outbound port 112; 122. For both devices 110, 120, said inbound/outbound port may be a hardware port, such as a wired or wireless communi cation interface. For instance, such an inbound/outbound port may comprise an ethernet cir cuit and slot connected to a motherboard bus of the device 110, 120 in question. In other examples the port 112, 113; 122, 123 comprises a Wifi antenna. Such communication ports are well-known as such, and will not be described in further detail herein, the important thing being that each round-trip communication between the first 110 and the second 120 device performed at different times will involve the same hardware circuitry in the device 110, 120 in question, even if the communication path taken between the devices 110, 120 may differ between different such round-trip communications. Preferably, the same combination of ports 112, 113; 122, 123 is used across several or all iterations (see below) performed within a method according to the present invention.

[0021] It is understood that the first 110 and second 120 devices each may comprise a re spective CPU, a respective electronic memory and a respective communication bus for de vice-internal communication. In particular, each of the first 110 and second 120 devices may be a general-purpose computer device, such as an internet server or client, an IoT sensor or actuator, a network attached storage unit, or any other internet-connected computer device. [0022] In all other respects, the functionality of the first 110 and second 120 devices de scribed herein, as well as the broader functionality of the system 100, may be implemented in software, in hardware or in any suitable combination of software and hardware.

[0023] In particular, the first device 110 has a first clock 111, preferably being arranged as a local part of the first device 110 and arranged to measure a local time of the first device 110. Similarly, the second device 120 has a second clock 121, preferably being arranged as a local part of the second device 120 and arranged to measure a local time of the second device 120. The first 111 and second 121 clocks may be non-synchronised in relation to each other. For instance, each of the first 111 and the second 121 clocks may be intermittently synchronised to a respective master clock, which may the same or different for the first 111 and second 121 clocks. In general, the first 111 and second 121 clocks may be arranged in such a way so that it is not possible to reliably predict a local time of the first device 110 only based on knowledge of a local time of the second device 120, and vice versa.

[0024] The system 100 further comprises a recursive filter means 117, which will be de scribed in detail below.

[0025] The system 100 is arranged to perform a method according to the present invention, an example of which is illustrated in Figure 3. In Figure 1, the system 100 is illustrated as comprising the first device 110 and the second device 120, and much of the functionality of the system 100 is implemented as part of the first device 110. This is one example of a pos sible implementation of a system 100 according to the present invention, in which the first device 110 may be a master device and the second device 120 may be a corresponding slave device. For instance, the first device 110 may be a network 10 monitoring unit, hardware and/or software and the second device 120 may be any other network-connected unit. Such a master unit 110 may analyse network 10 latency with respect to the slave unit 120, and also to any number of additional network 10 connected slave units or the same or different type. [0026] However, it is realised that, in this and other implementations, the second device 120 may be not a part of the system 100 but instead be completely standalone.

[0027] Furthermore, the functionality of the system 100 arranged to perform the method ac cording to the present invention may be not arranged as a part of the first device 110, but may instead be separately arranged in relation to the first device 110 and arranged to communicate with the first device 110 for performing the method steps of a method according to the present invention. Such communication may exploit proprietary protocols for communicating time measurement information, or may use sent information packages for carrying time measure ment information as explained below.

[0028] Namely, according to a preferred embodiment a method according to the present in vention is performed “in-band” in the sense that the communication messages described herein and sent as a part of round-trip time measurements as described below are not sent between the first 110 and the second 120 devices as separate communications only for the purposes of performing the present invention. Instead, these communications are communi cations that are sent during the course of normal communication between the devices 110, 120, and would as such be sent with a substantially equal or corresponding payload even if the round-trip time measurement being a part of the present method would not take place. For instance, the communications between the devices 110, 120 may be pinging, polling or information transfer communications performed as a part of a separate process which as such may be completely uncorrelated to the round-trip time measurement of the present invention, and may in effect be completely unrelated to the present method in any way apart from the fact that the present method exploits the messages in question for performing said time meas urements.

[0029] For instance, such “in-band” time measurement may be performed by the use of a software instruction being previously deployed in the respective clock 111, 121, before send ing said communication and instructing the respective clock 111, 121 to measure the times described below for the communications in question and to embed the measured time infor mation into the communicated message. Alternatively, software code may be appended to or included in the communicated message itself, causing such time measurement to take place during the course of a normal handling of the communication in question due to the software being executed during the course of the processing of the received message.

[0030] There are many different ways of recording time measurements obtained from said clocks 111, 121 and make them available for the decive 110. Typically, device 110 creates a data packet with four empty fields for time measurements followed by recording clock 111 reading in the first field before sending the data packet to device 120. Immediately upon receiving the data packet, device 120 records clock 121 reading in the second field before further processing the packet. When the packet is ready to be returned to device 110, device 120 again records clock 121 reading and stores the value in the third field. Upon receiving the returned packet, device 110 again records clock 111 reading and stores it in the fourth field. When this cycle is completed, the four fields of the data packet contain the four time measurements which are available for further processing.

[0031] Internet draft “Data Fields for In-situ OAM” (https://tools.ietf.org/html/draft-ietf- ippm-ioam-data-08) is a concrete example of a protocol that can be used to record and transport time measurements as described above. It is designed for recording In-situ Opera tions, Administration, and Maintenance (IOAM) records operational and telemetry infor mation in the packet while the packet traverses a path between two points in the network. [0032] In particular, many internet-connected hardware, such as commercial routers, imple ment functionality allowing such protocols or message syntax and to perform such time stamping accordingly. In such cases, there is no need to deploy any custom software on the second device 120 in order to perform such measurements.

[0033] In other examples, such hardware may support the loading and running of software within a virtual machine on the hardware in question. Then, a custom piece of software be longing to a system of the present type can be loaded into, and executed within, such a virtual machine for performing the second device 120 time-stamping without having to be locally installed directly on an operating system of the second device 120.

[0034] Hence, the time-stamping described herein can be performed using a specialized piece of software executing on or from the first 110 and/or the second device 120, or be performed without such software, such as using a protocol or message syntax of the above exemplified type.

[0035] In general, it is preferred that the communication messages themselves, between the first 110 and second 120 devices, carry the time measurement information as a part of the communicated message in question, at least for the part of the round-trip message going from the second device 120 to the first device 110.

[0036] In general, the method illustrated in Figure 3 may be performed by a computer soft ware product according to the present invention, which software product may be arranged to execute on hardware of the first device 110, the second device 120, a separate device, or any combination thereof. When hence executed, such a software product may then be arranged to perform the method steps illustrated in Figure 3, or at least cause these steps to be performed. Analogously, it may be said that it is then the system 100 that performs or causes to perform these steps.

[0037] Hence, in a first step, the method starts.

[0038] In a subsequent step, a first communication message (upper arrow in Figure 1) is sent from the first device 110 to the second device 120. In connection to the sending of this first message, a first communication send time t 1 is measured using the first clock 111, and a first communication receive time t 2 is measured using the second clock 121.

[0039] In a subsequent step, a second communication message (lower arrow in Figure 1) is sent from the second device 120 to the first device 110. The second communication message may be a message being sent as an explicit response to the first communication message, such as being sent directly in response to the first communication message. For instance, the first communication message may be an information query and the second communication message may be a response to said query, returning queried information from the responding second device 120 to the querying first device 110. In connection to the sending of this second message, a second communication send time t 3 is measured using the second clock 121, and a second communication receive time t 4 is measured using the first clock 111.

[0040] As mentioned above, it is preferred that the second device 120 adds the first commu nication receive time t 2 and the second communication send time t 3 to the second commu nication message, in a format allowing the system 100, such as the first device 110, to read this time measurement information from the second communication message for use in sub sequent calculations.

[0041] In general, the first device 110 may comprise a first measurement module 114 being arranged to perform a first time measurement process in which t 1 and t 4 are measured. Sim ilarly, the second device 120 may comprise a second measurement module 124 being ar ranged to perform a second time measurement process in which t 2 and t 3 are measured. Said first and second time measurement processes may each participate in the measurement ac cording to the present invention of latency metrics of the network 10 by intermittently or continuously sending, or observing the sending of, data packets over the computer network 10, including the send/receive time measurement of such sent data packets as described above, wherein each such data packet is sent from the first device 110 to the second device 120; received by the second device 120; resulting in a response sent by the second device 120 to the first device 110; and received by the first device 110. As mentioned, such messages are preferably sent during the course of some other, external process, which process as such may be unrelated to the round-trip time measurements performed according to the present invention, but where said first and second time measurement processes are designed (caused by the system 100) to perform said time measurements while handling the per se unrelated packet sending and receiving.

[0042] In other words, the first and second communication messages may each comprise information, or even contain only information, which as such is unrelated to the estimation of the first ci 1 and second d 2 latencies (see below). Furthermore, said information comprised or contained in the first and second communications may as such be unrelated to the meas ured first y x and second y 2 delays (see below).

[0043] As used herein, the term “latency” generally refers to a property of a communication network. Such latency can be constant over time but will normally vary in different ways. [0044] The term “delay”, on the other hand, refers to the time difference between send time and receive time of a particular communication. Hence, a communication delay will depend on a network latency but further incorporates various noise.

[0045] The communication messages may be any digital, electronic messages, sent using any suitable digital protocol for electronic communication, such as using conventional TCP/IP internet communication.

[0046] Furthermore, the communication messages may be observed in well-defined pairs, in which a first upstream communication message, sent from device 110 to device 120, is asso ciated with a corresponding second downstream communication message, sent from device 120 to device 110. Preferably, such a second communication message in such a pair is sent as a direct response to such a first communication message. It is understood that several con secutively communicated such communication message pairs may be used to estimate net work 10 latency as described herein.

[0047] In the example illustrated in Figure 1, the system 100, in this case the first device 110, comprises a timestamp module 115 being arranged to record, based on said respective in band-recorded information in each data packet received and processed at the inbound port 113 of the first device 110, the timestamp quadruple (t 4 , t 2 , t 3 , t 4 ). This may, for instance, involve the extraction of timestamp data from the received package stored therein using a predetermined data format by the communicating devices 110, 120.

[0048] As will be described in detail below, the system 100, and in the example of Figure 1 the first device 110, may further comprise a sampling module 116, being arranged to, in a subsequent step, sample the set of recorded timestamp quadruples (t 4 , t 2 , t 3 , t 4 ) obtained throughout each one of a series of sample intervals 244, 247 (see Figure 2), each sample interval being defined as a certain partition of a first device 110 clock 111 time line X-axis 241. Each sample interval 244, 247 may have a predetermined length, which may be the same or different for different sample intervals. In the example illustrated in Figure 2, each sample interval 244, 247 have the same predetermined length, defined by a sampling period 243. [0049] A respective round-trip time t 4 — T- L — (t 3 — t 2 ), measured on a round-trip time Y- axis 242, of the data packets of each of said round-trip samples (t 4 , t 2 , t 3 , t 4 ) are then com pared, and the particular quadruple 246 of the sampled packets associated with a minimum round-trip time may be determined for each sample, by said sampling module 116. It is noted that this round-trip time is actually calculated not taking into consideration any hold time in the second device 120, by taking the locally measured difference between the receive and send times at the first device 110 and subtracting from this result the locally measured time difference between the send time and the receive time at the second device 120. This will result in the result being unaffected by a hold time at the second device 120, only counting the effective total round-trip transit time for the first and second communication messages. To see this, it may be instructive to ponder the effect of an increased second device 120 hold time under an unchanged transit time. The effect will be an increase of the total time differ ence between dispatch of the first message from port 112 and reception of the second message at port 113, which increase is exactly the same size as the hold time increase, hence not changing the calculated total round-trip time.

[0050] Using a sampling of said general type, the method may hence reiterate back to the step of sending the first communication message, but now using a third, fourth and further communication message, during one and the same sample interval.

[0051] In a subsequent step, a first measured delay y 4 is calculated as the difference between the first communication receive time t 2 and the first communication send time t 4 , and a second measured delay y 2 is calculated as the difference between the second communication receive time t 4 and the second communication send time t 3 . These calculations may be made for all measured quadruples (t 4 , t 2 , t 3 , t 4 ) or only for the one 246 selected, by the sampling module 116, to have the shortest total round-trip time for each sample interval 244, 247. [0052] In a subsequent step, said first measured delay y 4 and said second measured delay y 2 are provided to a recursive filter function 117, which in the example of Figure 1 is illustrated as a part of the first device 110 but, again, may be arranged logically and/or physically ex ternally to the first device 110.

[0053] This recursive filter function 117 is arranged to estimate a first (upstream) latency d 4 , for a communication message to be sent from the first device 110 port 112 to the second device 120 port 123, and a second (downstream) latency d 2 , for a communication message to be sent from the second device 120 port 122 to the first device 110 port 113. These laten cies d d 2 are estimated based on said first measured delay yq, said second measured delay y 2 , a value for the first latency ci 1 previously estimated by said recursive filter function 117 and a value for the second latency d 2 previously estimated by said recursive filter function 117. Said previously estimated latency values may preferably be latency estimations per formed in the corresponding or identical way for previous communication messages sent between the same first 110 and second 120 devices in substantially the same way as the first and second communication messages illustrated by arrows in Figure 1. Similarly, the values for d , d 2 estimated using the first and second communication messages of Figure 1 and sample 245 may be used as inputs to the recursive filter function 117 for a subsequent recur sion made based on a third and a fourth communication message and a later sample interval 248. These previous and later messages may be not of the same type or not carry the same or corresponding payload. However, it is preferred that such previous and later messages are sent directly between the first 110 and second 120 devices via the network 10 deploying the same network-specific device 110, 120 settings. The communication paths taken for such messages through the network 10 may differ, and this may not even be possible to know from the point of view of the devices 110, 120 or the system 100.

[0054] That the filter function 117 is “recursive” means that an output of the filter function 117 is fed back into the filter function 117 in a later, such as an immediately subsequent, iteration of the method using the filter function 117, such as after the next sampling as men tioned above.

[0055] Thereafter, the method may again reiterate back to the step of sending a third, fourth or further communication message.

[0056] It is understood that, in the way used herein, the term “estimated latency” refers to an estimation of a real latency, in other words the actual time difference between the send time and the receive time of a communication message.

[0057] In contrast thereto, a “measured delay” is a delay measured using local clocks 111, 121. Hence, the measured delay may be incorrectly measured, in case the local clocks 111, 121 show different time.

[0058] The present inventors have found that, using such a seemingly simple process, it is possible to over time arrive at surprisingly accurate estimations of real network latencies between connected devices 110, 120, in particular when a relative clock setting of the devices 110, 120 in question is not a priori known. Furthermore, such a method has proven to yield accurate results when used in-band, in other words taking advantage of network traffic that would take place anyway, only adding the locally measured timing information to commu nicated data packages.

[0059] In a step performed after the application of the recursive filter 117 and before reiter ation of the method back to the sending of the first or further communication messages, the estimated latency information is provided to an external system and/or to a user of the system 100 or the network 10 Such provision may take place continuously as updated estimation data becomes available; intermittently; or upon request by the external system or the user. Uses of this estimated latency data includes planning, developing, monitoring, maintenance and operation of the network 10. The external system may be an automated surveillance sys tem, consuming the estimated network latency information produced by the inventive system 100, detecting patterns according to predetermined rules and/or using neural networks or similar, and setting off alarms or performing network 10 adjustments as a reaction to such detected patterns. For instance, in case network 10 latency between two identified devices 110, 120 increases above a predetermined level, an intermediary network 10 server may be automatically restarted, and/or an alarm may be triggered alerting an operator or an automatic monitoring function of the detected problem. It is realised that such an external system may use the inventive system 100 to automatically monitor large numbers of network 10 con nected devices 110, 120, such as at least 100, or even at least 1000, such devices connected to one and the same network 10.

[0060] In general, the present method and system can be used as a part of an automatic or semi-automatic monitoring solution, in which delay, latency and/or jitter may be measured and evaluated over time according to the principles described herein and comparison with predetermined threshold values such as defined by applicable service level agreements for the monitored network infrastructure. Then, a particular sequence of operations may be au tomatically performed by the present system if and when such service level agreements are violated or when predetermined threshold values in terms of delay, latency and/or jitter are exceeded. Such sequences of operations may include a healing scenario, wherein a first step may be to stop monitoring, a second step may be to check if all devices involved in providing a particular service are in sync, a third step may be to redeploy the service in question (in cluding all involved devices), a fourth step may be to run an activation test followed by finally restarting the monitoring procedure. Such a sequence of operations may be performed fully or partly automatically by the present system, such as by the first device 110 or a supervising system entity. Another example of a sequence of operations is a healing and troubleshooting scenario, wherein a first step may be to stop monitoring, a second step may be to attempt a redeploy the service, a third step may be to start a troubleshooting procedure covering the network layer and network location in question. Again, these steps may be performed fully or partly automatically, including said troubleshooting that may be performed automatically for instance based on predefined test cases to be run in a particular sequence with the aim of more precisely identifying a problem.

[0061] In general, latency is one of the key metrics for most applications in a computer net work. It is therefore important to monitor latency closely, and to make sure it is kept within certain predetermined limits. If there is a latency issue (too high latency), it is important to be able to quickly find and fix the root cause of that issue. Also, being able to understand the latency in each traffic direction will help in the work of resolving the issue and restoring the latency to an acceptable level. Therefore, the present invention may preferably comprise providing continuously or intermittently updated information regarding recent latency meas urements in both communication directions.

[0062] Furthermore, the present inventors have found that the recursive filter function 117 may be designed in various ways. For one thing, the recursive filter function 117 may advan tageously be designed at least based on one or several of a number of assumptions. This achieves a simple filter design, being implementable with low CPU footprint, while still yielding accurate results. Below, detailed examples will be provided, while we in this section of the application merely present the main such assumptions discovered by the present in ventors.

[0063] Hence, a first such assumption is that a difference d between the first latency ci 1 and the second latency d 2 is constant over the steps of sending said first and second communica tions in one single iteration of the method. In other words, the filter 117 is constructed using the assumption that a difference S(t ) = ci^t) — d 2 (t) is constant across the interval [t 1 t 4 ], where t t is an actual (objective) time at which the measurement of is made for i=1..4. [0064] A second such assumption is that said difference d decreases across iterations of send ing consecutive further communication messages back and forth between the devices 110, 120, or is zero, possibly apart from a random term.

[0065] A third such assumption is that a time offset O between the first clock 111 and the second clock 121 is constant over the steps of sending said first and second communications in one single iteration of the method. In other words, the filter is constructed using the as sumption that the time offset O is constant across the interval [t 1 t 4 \.

[0066] A fourth such assumption is that the second clock 121 is associated with an offset drift T in relation to the first clock 111 and that this offset drift is constant or behaving as a random walk process. It is particularly noted that the third and fourth assumptions can be applied one or both, irrespectively of each other, since the third assumption is valid across one single iteration while the fourth assumption is valid across several iterations (the sending of several consecutive double-directed communication messages between the devices 110, 120, such as across different sample 245, 248 of the above-described type).

[0067] In some embodiments, the recursive filter function 117 is arranged to achieve, as an output of the filter function 117 as applied to a first sample 245, a computed estimation of the second clock 121 offset O in relation to the first clock 111 and/or the second clock 121 drift T in relation to the first clock 111. Then, this estimated offset O and/or drift T may be used by the filter function 117 when processing a next sample 248 throughout a next sample interval 247. It is noted that the corresponding may be the case if each sample holds only one communication message in each direction between said devices 110, 120.

[0068] In a very preferred embodiment of the present invention, the recursive filter function 117 comprises a Kalman filter used in said estimations of the first latency d and the second latency d 2 . As is well-known as such, a Kalman filter is a recursive tool that can provide an updated estimation of a dynamical state of a system under noisy data conditions in the pre sent case, the Kalman filter can be used to estimate the updated state of said offset O and/or drift T of the second clock 121 in relation to the first clock 111, and based on these estima tions a current network 10 latency can be estimated and expressed using suitable parameters. [0069] In general, a Kalman filter may be used to produce not only an updated estimation of a system state, but also a residual indicating how far from the estimated state is the true system state. Hence, in some embodiments the present method further comprises determining such a residual value with respect to said estimated first d and/or second d 2 latency, and/or with respect to a sum of the estimated first d and second d 2 latencies. Such a residual value, or a value calculated based on several such residual values from several iterations (such as a moving average of such residual values) may then be provided as an updated dynamic esti mation of the reliability of the network 10 latency estimation provided by the present system 100. For instance, the residual, or a value determined based on the residual, can be provided to an operator of the network 10 or of the system 100 according to the present invention, to be used as a measure of the current reliability of the network 10 latency estimated metrics. In some embodiments, the system 100 may be arranged to trigger an event, such as an alarm, in case the residual or a value determined based on the residual exceeds a certain threshold value, and/or in case the residual or value makes a jump of sufficiently short duration and sufficient magnitude. In other embodiments, such an alarm may be set off in case any estimated network 10 latency metric produced by the system 100 makes a corresponding sufficiently quick and large jump.

[0070] In some embodiments, the present method may comprise the step, subsequent to the application of the recursive filter function 117, of calculating said estimated current second clock 121 offset O and/or drift T, in relation to the first clock 111, based on the estimated first d and second d 2 latencies.

[0071] As mentioned above, and as illustrated in Figure 2, the steps of sending the first and second communications, measuring the related local times t 1 , t 2 , t 3 , t 4 and calculating said measured delays y 1 ,y 2 may be iterated over a predetermined sampling period 243. As a re sult, several delays y 1 ,y 2 will be measured, based on local clock 111, 121 measurements, during one and the same sample interval 244, 247. Then, the shortest first (upstream) meas ured delay may be used as the first measured delay y 1 fed into the recursive filter function 117 and the shortest second (downstream) measured delay may be used as the second meas ured delay y 2 fed into the recursive filter function 117. Alternatively, and as already de scribed above, the first and second measured delays from one and the same communication message pair for which the smallest sum 246 of first and second measured delays may be used as the first y x and second y 2 measured delays provided to the recursive filter function 117.

[0072] To the recursive filter function 117, a current sample 245 timestamp may be provided, representing a system-global time period at which the measured delays y v y 2 were observed. In some embodiments, this current sample 245 timestamp may be determined in relation to the predetermined sampling period 243 (or expressed differently: in relation to the current sample interval 244), rather than in relation to the actual measurement time, within the sam pling period 243, of the first y x or second y 2 measured delays provided to the recursive filter function 117. In other words, in such cases the current sample 245 timestamp is determined based on a temporal location of the sample 245 or the sample interval 244 as such, rather than on the measurement time of one or several delays y 1 ,y 2 within that sample 245. For instance, an end time point, a beginning time point or a midpoint of the sample interval 244 within which said measurements were made can be used as the current sample 245 timestamp. Preferably, the same way of determining the sample timestamp is used for all samples 245, 248. Most preferably, these sample timestamps are equitemporally distributed. [0073] The sample time period 243 may be different across different samples 245, 248, but the sample time period 243 is preferably constant, being the same for each sample 245, 248. Suitable sample periods 243 vary with application, but typically the sample period 243 is at least 0.1 seconds, such as at least 1 second, and at the most 100 seconds, such as at the most 10 seconds. The sample time period 243 may be selected so that, for at least for one sample 245, 248, such as for at least 50% of all samples 245, 248 over time, each sample 245, 248 comprises at least 10 measured delay pairs y \ ,y 2. In other words, during such sample(s), at least 10 communication message pairs are sent and measured between the devices 110, 120. [0074] Even though the sample period 243 is preferably selected as a temporally defined period, it is also foreseeable to use as the sample period 243 a predetermined number of processed communication messages, whereby the sample period 243 will be time-variable between different samples 245, 248. Then, each sample 245, 248 may constitute at least 5 samples, such as at least 10 samples.

[0075] Using a series of temporally extended samples 245, 248 this way achieves a smaller data and computational footprint, while still achieving reliable network 10 latency estima tions.

[0076] It is realised that the present method may be iterated indefinitely, the recursive filter function 117 being provided with updated measured delays y 1 ,y 2 and producing updated network 10 latency estimates d 1 cl 2 for as long as desired. The present inventors have found that the method may be iterated over at least 10, more preferably at least 100, consecutive recursive filter function 117 iterations (samples 245, 248) to provide very accurate network 10 latency estimations.

[0077] Again reverting to Figure 3, in a further method step, the estimated relative time offset O and the relative offset time drift T between the first clock 111 and the second clock 121 may be used for synchronising the first clock 111 with the second clock 121. In the extension, this may be used for temporally synchronising the first device 110 with the second device 120, for instance as a way to set the second device 120 clock 121 to the same time as the first device 110 clock 121, or to adjust timing parameters for collaboration activities, such as time- critical communication activities, between devices 110, 120.

[0078] In such a method for synchronising the first local clock 111 of the first device 110 in relation to the second local clock 121 of the second device 120, the above-described steps of sending the first and second communications; measuring the first and second delay y l y 2 , and estimating the first and second latencies d 1 d 2 are first performed, such as iteratively. Then, said relative time offset O and relative offset time drift T are determined. Thereafter, in a subsequent step said first 111 and second 121 clocks are synchronised based on said relative time offset O and relative time offset drift T. [0079] In practise, the system 100 may comprise a synchronisation module 118 (see Figure 1, where for exemplary purposes the synchronisation module 118 is implemented as a part of the first device 110), into which each timestamp quadruple (t^ t 2 , t 3 , t 4 ) obtained is input, and which synchronisation module 118 then computes and outputs a corresponding synchronised timestamp quadruple (t^ t 2 + D, t 3 , t 4 + D), where D = O + T I- L — x start ) and T start is the value of the first device 110 clock 111 at the start of the current sample interval 244 and where O and T are relative offset and drift as above. Then, the measurements performed in relation to said communication messages sent between devices 110, 120 are synchronised for each data packet sent according to the synchronised timestamp quadruple ( i, t 2 + D, t 3 , t 4 + D).

[0080] As mentioned above, the invention also relates to the system 100 as such, for meas uring a communication latency between devices 110, 120. The system 100 then comprises the recursive filter means 117, and is arranged to, iteratively, perform the following steps:

1) Receive or record the measurements t 4 , t 2 described above, being measured in relation to the first communication sent from the first device 110 to the second device 120.

2) Receive or record the measurements t 3 , t 4 described above, being measured in relation to the second communication sent from the second device 120 to the first device 110.

3) Calculate the first and second measured delays y 1 ,y 2 as described above.

4) Estimate, using the recursive filter means 117, the first and second latencies d , d 2 as described above.

[0081] As also mentioned above, the invention also relates to a computer software product for measuring a communication latency between devices 110, 120. The computer software product may be centralised or distributed, and may comprise several interacting subparts, such as a local application installed and arranged for execution on the first device 110 and/or second device 120 hardware and/or in a central server.

[0082] When executed on one or several computer processors, the computer software product is then arranged to perform the following steps:

1) Receive or record the measurements t 4 , t 2 described above, being measured in relation to the first communication sent from the first device 110 to the second device 120.

2) Receive or record the measurements t 3 , t 4 described above, being measured in relation to the second communication sent from the second device 120 to the first device 110.

3) Calculate the first and second measured delays y 1 ,y 2 as described above.

4) Estimate, using the recursive filter means 117, the first and second latencies d , d 2 as described above. 5) Reiterate from step 1.

[0083] In an example of a recursive filter 117 of the above-described type, for use with the first device 110 as a master device and the second device 120 as a slave device, the filter 117 is set out according to the following.

[0084] For each current sample, the quadruple with minimum round-trip time of the current sample at the end of the current sample interval is input to the recursive filter 117, that then computes and outputs the slave clock offset O and slave clock drift T to be used when pro cessing the next sample throughout the next sample interval, wherein t denotes true time and t x , t 2 , t 3 , t 4 are the true time instants when the packet is sent from the master device, received by the slave device, sent from the slave device, and received by the master device, respec tively; wherein d is the upstream latency(estimated by t 2 — iq) from master to slave; ci 2 is the downstream latency (estimated by t 4 — t 3 ) from slave to master, and wherein x m (t) and t s (t) are independent clock signals corresponding to the master clock and the slave clock, respectively. Hence, this yields t 4 = t hi 1 ),t 2 = t 3 2 ),t 3 = T s (t 3 ),r 4 = r m (t 4 ).

[0085] Moreover, y x and y 2 are measurements of t 2 — t 1 and t 4 — t 3 , respectively, both subjected to random measurement errors. d — d 2 is small and the correlation between d and d 2 as well as the correlation between y x and y 2 is strong when the upstream and down stream paths are the same. Measurements y 4 and y 2 are used to produce latency estimates d 1 and d 2 as for some functions and f 2 , where k is is the sample number, n(k ' ) is a vector of parameters, and z(k ) is a vector evolving as 2 (fc + 1),p(L + 1)), in turn for some function / 3 , and wherein an estimate c of the correlation between y x and y 2 affects the computation of latency estimates via the parameters p such that d 1 — ά 2 converges faster to zero when c is large and slower when c is small. [0086] The filter 117 inputs, for each current sample, the quadruple with minimum round- trip time of the current sample at the end of the current sample interval and computes and outputting the slave clock offset 0 and slave clock drift T to be used when processing the next sample throughout the next sample interval.

[0087] The synchronisation module 118 inputs each timestamp quadruple (t 1 ,t 2 ,t 3 ,t 4 ) ob tained during measurement, and computes and outputs a corresponding synchronised quad ruple the value of the master clock at the start of the current sampling period, wherein the measurements performed for each data packet are synchronised according to the corresponding synchronised timestamp quadruple.

[0088] In this example, the filter 117 is implemented using a Kalman filter in the following way. The difference between upstream latency and downstream latency S(t ) = d 4 (t) — d 2 (t) and the offset between the master clock and the slave clock 0(t) = r s (t) — r m (t) vary slowly in time, so that <5(t) and q(ΐ ' ) are approximately constant in the time interval [t 4 , t 4 ] and the random measurement error of * is n L such that the relationship between the meas urements y 4 and y 2 and the upstream- and downstream delays are y 4 = d t + Q + n x and y 2 = d 2 — Q + n 2 , respectively. Thus, both measurements are subject to the error Q. The round-trip time is defined as r = d + d 2 , and it follows that d t = (r + <5)/2 and d 2 =

(r — <5)/2 yielding

[0089] Further assume the following:

• Measurement noises n L are zero-mean white-noise sequences with covariance ry

• (L>i, i = 1. .4, are 4 independent zero-mean white-noise sequences with covariance q re spectively;

• The round-trip time evolves as a random walk r(k + 1) = r(/c) + w 4 (/ί);

• The latency difference evolves as S(k + 1) = aS(k) + w 2 (/ί ) where 0 < a < 1;

• The offset evolves as 6(k + 1) = hp(k ) + m 3 (/c), where h is the time interval between two consecutive samples and p(k) is the relative drift between master clock and slave clock, which in turn is assumed to evolve as the random walk p(k + 1) = p(k) + u> 4 (/c). [0090] It is noted that one or several of these assumptions can be applied in the general case. In other words, the filter function 117 may generally be designed under one or several of these assumptions, similarly to the design assumptions discusses above.

[0091] By defining the measurement vector y the state vector x = [r d Q p] T , the disturbance vector w = [<^i <^2 w 3 w 4] t , the noise vector n = [«I n 2] r , and the pair of matrices

1 0 0 O

0 a 0 0

A =

0 0 1 h

0 0 0 1 and the assumptions above and the measurements can be formulated as x(k + 1) = Ax(k ) + w(/t) y(k ) = Cx(k ) + n(/c), yielding an estimate i of the state vector by employing the Kalman filter, where Q = diag [<fa <J3 < \, R = diag[> 1 p2], and where the symmetric

Pll P12 Pl3 Pl4

P12 P22 P23 P24

Pl3 P23 P33 P34 Pl4 P24 P34 P44 is given by the Riccati equation

The latency estimates are then obtained as x

[0092] In general, the covariances and r which are defined as the expected values of (L>i(k) 2 and rq(/i) 2 , respectively, are not known and may be difficult to estimate. Instead, one may take the values of these to be design parameters of the proposed algorithm. Hence, going further, the intensities qt and r L may be adjusted in the recursive filter 117 to achieve desired convergence properties. A reasonable assumption is that the properties of the measurement noise for the upstream and downstream delays are equal, i.e. that r 1 = r 2 = r 0 for some pos itive r 0 . Then it may be shown that the convergence properties of the estimates are com pletely determined by the quotients qt/r 0 ( with i = 1. .4). Hence, we may choose an arbi trary fixed value of r 0 which leaves qi available as design parameters to control the conver gence rate of the estimate - faster convergence rate is achieved by increasing q L and slower convergence rate is achieved by decreasing q L. This general behaviour of the convergence is achieved in steady-state when the Riccati equation has converged, i.e. for k ® ¥. Hence, by initializing the Riccati equation with a P 0 = P(0) that is different from its final value P ¥ = lim P(/c), it is possible to have different behaviour in the initial phase compared to the k® co steady-state behaviour.

[0093] In conclusion, the most important tuning parameters of the Kalman filter are the dis turbance covariances q^, the convergence parameter a of the evolution of the delay differ ence, and the initial value matrix P 0 of the Riccati equation. In general, the values of these parameters should be adjusted so that the Kalman filter produces accurate estimates out of test data sets with known values of clock offset and delays.

[0094] Sufficiently small values of q 3 and q 4 in relation to q 2 will serve to keep b close to constant, such as within 10 ppm or less, and the offset estimate to follow @(k + 1) = $(k) + hp(k) whereas the delay estimates ά 1 and ά 2 change in response to changes in the measure ments. Moreover, a(k) is chosen close to 1, which will make the convergence of (/c) ® 0 slow, allowing ά 1 and ct 2 to change independently of each other. This configuration, denoted A in the following, is useful when an upstream communication path through the network 10 is believed to be different from a downstream communication path through the network 10, leading to weakly correlated upstream/downstream delay measurements (upstream meaning from master to slave and vice versa). That the upstream and downstream paths can be as sumed to be different can often be inferred using known external parameters, and may there fore in such cases be treated as a priori information in particular embodiments. In particular, the present method may include an initial step in which the upstream and downstream paths are analysed and determined to be treated as identical or different. Then, this assumption is used when applying the present calculations.

The following are parameter values used in an examplary run-through of a method according to the present invention consistent with configuration A:

Parameter Value r 0 0.5 q 4 0.11 q 2 0.09 q 3 0.000025 q 4 0.000001 a 0.9

[0095] Conversely, when the upstream path is believed to be the same as the downstream path, so that the upstream/downstream delay measurements are strongly correlated, a differ ent recursive filter 117 configuration, denoted B in the following, may be used. Namely, using sufficiently large values of q 3 and q 4 in relation to q 2 will cause the estimate of the latency difference to converge to 0 following &(k + 1) = a&(k), while the clock parameter estimates ΰ and b change in response to changes in the measurements. Moreover, a(k ' ) is chosen closer to 0, which will make the convergence of &(k) ® 0 fast, forcing ά 1 and ά 2 to converge to each other.

[0096] To automatically achieve the above-described adaption to whether upstream and downstream paths are the same or different, one may use the correlation estimate c(k ' ) (be tween y 4 and y 2 , see above). The recursive filter 117 can be configured such that the param eters a, q 2 , q 3 , q 4 are made to vary in time depending on c(k ) as a(k) = a Q — bc(k) q 2 (k) = q 2 o - b 2 c(k ) q-ii ) = ( ?3o + ¾ 3 c(fe) q (k) = q 40 + b c(k) for some non-negative constants a 0 , q 20 , q 30 , q 40 , b, b 2 , b 3 , and b 4 .

[0097] In this way, configuration A (i.e., large a, q 2 and small q 3 , q 4 ) will be activated when the correlation estimate c(k ' ) is small (close to 0) and configuration B (small a, q 2 and large q 3 , q 4 ) when c(k ) is large (close to 1).

[0098] Another possible functionality of the algorithm is to let it estimate the clock parame ters initially and then gradually go over to estimating the latencies which is useful if it can be assumed that the latencies are almost constant during the initial phase. The initial phase can be achieved by choosing the parameter values a, q 2 , q 3 , q 4 according to configuration A but choosing the initial value P 0 of the Riccati equation close to a P ¥ that would be the result from choosing a, q 2 , q 3 , q 4 according to configuration B. In this way, as P(k) transitions from P 0 to its final value, the behaviour of the algorithm will transition from that of config uration B to configuration A.

[0099] Above, preferred embodiments have been described. However, it is apparent to the skilled person that many modifications can be made to the disclosed embodiments without departing from the basic idea of the invention.

[0100] For instance, even if the present method can be performed completely in-band, in cases where a particular device needs to be checked in terms of current latency it is in some embodiments possible that the inventive system in addition to said in-band messages also executes the sending of communication messages only for the purpose of creating network traffic to and from that particular device so as to be able to produce an updated latency esti mation.

[0101] Apart from latency and delay, the present invention can also be used to produce reli able estimations of jitter (the difference between a minimum and a maximum delay or latency observed during a particular predefined time interval).

[0102] It is understood that determined latency estimates and/or offset/drift corrected time measurement data can be sent to said external system or to the user for further action, as the case may be. Alternatively or additionally, these data may be stored in a system 100 internal database for later use, such as for statistical use in order to perform predictions based on historical data.

[0103] Normally, the calculated values for relative clock drift T and offset O are themselves not communicated externally to the system 100, but kept as system 100 internal data.

[0104] In general, the various embodiments described herein, including the detailed exam ples, should be seen as examples of different aspects of a methodology used by the present invention to produce latency estimates in a network. As such, all the techniques and design principles discussed herein are freely combinable, subject only to compatibility.

[0105] Hence, the invention is not limited to the described embodiments, but can be varied within the scope of the enclosed claims.