Abstract:
Disclosed are a method and system for detecting point. The method of this invention comprises the steps of providing a set of points representing measured time delays between two clocks, providing a turning indicator to measure a magnitude of turns per measurement interval, and identifying a turn at a given point when the turn indicator at said given point is above a given value. With the preferred embodiment of the invention, the turn indicator is given by the equation: turn_indicator=(rtt_min−rtt_estimate)/number_of_points; where rtt_min is the minimum round trip delay in all the measurement points, and rtt_estimate is estimated round trip delay by using the symmetric convex hull algorithm.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
   This application is related to copending application Ser. No. 11/223,878 for “Clock Filter Dispersion,” filed herewith; application Ser. No. 11/223,876, for “Method And System For Clock Skew And Offset Estimation,” filed herewith; and application Ser. No. 11/223,577 for “Use of T4 Timestamps To Calculate Clock Offset And Skew,” filed herewith. The disclosures of the above-identified applications are herein incorporated by reference in their entireties. 
   BACKGROUND OF THE INVENTION 
   1. Field of the Invention 
   This invention generally relates to computer systems, and in particular to time synchronization in computer systems. Even more specifically, the invention relates to methods and systems for calculating clock offset and skew between two clocks in a computer system. 
   2. Background Art 
   Modern computers use clocks for many purposes, including ensuring that many operations occur in the proper sequence or in synchronization. Because of this, it is important that the clocks themselves operate in close synchronization. Typically, two clocks are often not in perfect synchronization, and there are timing differences between the clocks. In addition, two clocks may not operate at the exact same frequency, so that the timing difference between the clocks changes over time. This change in the timing difference between the clocks is referred to as the clock skew. 
   Many computer timing protocols require information such as the estimation of the skew and offset between two clocks. These two clocks may be, for example, a local clock and its source clock. For example, the Server Timing Protocol (STP) requires the estimation of the skew and offset between the local clock and the clock source. The accuracy of the estimation is crucial for the synchronization accuracy of the protocol. While methods and systems to measure clock skew are known, these known procedures tend to be quite complex, unreliable in certain situations, or both. 
   Moreover, estimating clock skew and offset can be complicated by turning points in the time delay data. Because of this, turning point detection is crucial in the mixed CTN environment, when, for example ETR (9037) is the clock server. As ETR can change its steering rate by 25 ppm without informing anyone, the synchronization algorithm needs to quickly detect such turns. Any delay in the detection can result in the loss of tens of microseconds in accuracy. 
   SUMMARY OF THE INVENTION 
   An object of this invention is to improve the accuracy of the estimation of the clock skew and offset between two clocks in a computer system. 
   Another object of the present invention is to provide a turning point identification algorithm to quickly detect changes in the steering rate at a clock source. 
   These and other objectives are attained with a method and system for detecting a turning point in a sequence of points. Generally, the present invention uses a turning point detection algorithm that is based on the convex hull algorithm and, in addition, uses an indicator to differentiate the turns from the observed noise. More specifically, the method of this invention comprises the steps of plotting a first set of points; and plotting a second set of points, wherein said plots form a channel therebetween. The method comprises the further step of using a turn indicator to identify any turning points in said channel. Preferably, the step of using the turn indicator includes the steps of using the turn indicator to measure a magnitude of turn per measurement interval, and identifying a turn at a given point in said channel when the turn indicator at said given point is above a given value. 
   With the preferred embodiment of the invention, the turn indicator is given by the equation: 
             turn_indicator   =         (     rtt_min   -   rtt_estimate     )     /   number_of     ⁢   _points       ;         
where rtt_min is the minimum round trip delay in all the measurement points, and
 
   rtt_estimate is estimated round trip delay by using the symmetric convex hull algorithm. 
   Also, preferably, the turn at a given point is identified as a turning point if at that point:
 
turn_indicator&lt;=rtt_std;
 
where, rtt_std is the standard deviation of the round trip delays for all the measurement points.
 
   Further benefits and advantages of the invention will become apparent from a consideration of the following detailed description, given with reference to the accompanying drawings, which specify and show preferred embodiments of the invention. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  illustrates a network of data processing systems in which the present invention may be implemented. 
       FIG. 2  illustrates a packet exchange between a clock machine B and a clock server A in the network of  FIG. 1 . 
       FIG. 3  illustrates forward and backward delay lines. 
       FIG. 4  shows an example of a turning point detection algorithm in accordance with the present invention. 
       FIG. 5  shows the results of applying the turning point identification algorithm to local clock correction. 
   

   DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1  illustrates a computer network  100 , including servers  102 , clients  104  and data storage unit  106 . Network  100  also includes data connections  110  for transmitting data between the devices of the network. Network  100  may be, for example, the Internet, but could also be an intranet, a local are network a wide area network, point-to-point links, or other networks. 
   Any suitable servers  102  may be used in the network  100 . Also, the clients  104  of network  100  may be, for example, personal computers, laptop computers, servers, workstations, main frame computers, or other devices capable of communicating over the network. Similarly, connectors  110  may comprise a wide range of suitable devices, such as wire, fiber optics or wireless communication links. 
   As mentioned above, various computer timing protocols, including the Server Timing Protocol (STP), require calculating the skew and offset between two clocks in computer systems or networks, such as network  100 . Calculating or estimating these values can be complicated by turning points in the data used to calculate or estimate the values. The present invention provides an improved procedure for identifying those turning points. 
   Reference is first made to  FIG. 2 , which illustrates a packet exchange between a local machine B and a clock server A. The packet leaves B at time T 1 , according to B&#39;s clock. The packet arrives at A at time T 2 , according to A&#39;s clock. Machine A then sends a reply packet at time T 3 , according to A&#39;s clock. The reply message reaches B at time T 4 , according to B&#39;s clock. By sending out this kind of exchange message regularly and recording the sequence of T 1 , T 2 , T 3 , T 4  timestamps, one can obtain estimates of the relative offset and speed difference between the clock of machine B and the clock of machine A. 
   Procedures are known that compute a sequence of forward and backward delays, (FD and BD) from the sequence of T 1 , T 2 , T 3 , T 4  timestamps. For example, such procedures are described in U.S. patent application Ser. Nos. 09/920,138 and 10/157,610 and in U.S. Pat. No. 6,661,810. In particular,
 
 FD=T 2 −T 1,  BD=T 4− T 3.
 
   Let&#39;s use T 1 ( i ), T 2 ( i ), T 3 ( i ), T 4 ( i ), FD(i) and BD(i) to denote the timestamps and delays for the i th  packet exchange. Prior arts constructs two sets of delay points in the two dimensional plane, {(T 1 ( i ), FD(i))|i=1, . . . } and {(T 1 ( i ), BD(i))|i=1, . . . }. U.S. Pat. No. 6,661,810 considers the two sets of points independently, which may not yield accurate results as the present invention. U.S. patent application Ser. Nos. 09/920,138 and 10/157,610 consider the two sets of delay points jointly, which yield better accuracy than U.S. Pat. No. 6,661,810. 
   In the Server Timing Protocol (STP) environment, for example, it is possible that a remote server changes its steering rate without informing all the machines who are using it as a time source. For example, when ETR is used as a stratum  1  server, it can change its steering rate by as much as 25 PPM without notifying the other machines. When there is a sudden change in steering rate at the clock source, normal estimation algorithms may not be able to recognize this steering effect right away. It can take some time for the normal algorithms to realize the change in steering and correct for it. The present invention provides a turning point identification algorithm to quickly detect this change in steering rate within the filter points. For noisy delay channels, it can be difficult to distinguish the turn due to noisy data from the real turns. This is exactly where the challenge lies for this kind of identification algorithms. 
   General change point detection algorithms in statistics can be used to detect changes in the statistical behaviors for time series. However, such algorithms can take a long time in detecting the turning points, due to the continuous nature of the delay points. In patent application Ser. No. 10/157,610, two algorithms are presented to detect the jumps and turning points in the delay traces. However, these two algorithms do not take the delay characteristics into account. In particular, the noise levels in the delay traces have no significant impact in the detection of the turning points. 
   In accordance with the present invention, another heuristic algorithm is used in STP to identify the turning points in the delay filters. This invention defines a turn_indicator to measure the magnitude of the turn per measurement interval. If this magnitude is larger than the intrinsic noise in the delay data, then the turning amount is more likely to be due to a real turn, rather than due to the random noise. Specifically, the variables are defined below: 
             turn_indicator   =         (     rtt_min   -   rtt_estimate     )     /   number_of     ⁢   _points       ;                 valid_solution   =     TRUE   ⁢           ⁢   if   ⁢           ⁢     (     turn_indicator   &lt;=   rtt_std     )         ;         
Here rtt_min is the minimum round trip delay in all the measurement points. rtt_estimate is estimated round trip delay by using the symmetric convex hull algorithm. rtt_std is the standard deviation of the round trip delays for all the measurement points. One can look at  FIG. 3  and imagine a flexible pipe  202  between the forward and negative backward delay lines  204  and  206 . More specifically, in  FIG. 3 , line  204  represents the forward delay sequence, and line  206  represents backward delay sequence. Dashed lines  210  and  212  represent remote clock turning (flexible pipe). Width=round_trip_delay (measurement). Lines  214  show the result of the algorithm without turning point detection. Width=round_trip_delay (estimated). The flexible pipe may turn from time to time. rtt_min corresponds to the narrowest point of the pipe. rtt_estimate is the diameter of a straight pipe between the delay lines. In the event of no turning points, the difference between rtt_min and rtt_estimate is small. When there is a turning point, the difference divided by the number of points corresponds to the deviation per measurement interval. If this deviation is larger than the intrinsic noise level, which is the standard deviation of the round trip delays, then the deviation is likely to be from a real turn than from just noise.
 
   After a turning point in the measurement points is detected, the turning point is assumed to be the vertex computed from the symmetric convex hull algorithm. The symmetric convex hull algorithm is run again for the measurement data after the turning point and the identification process is repeated. The process stops if a turning point is not detected, or when there are only two points left.  FIG. 4  illustrates an example of this turning point detection algorithm. In particular, in  FIG. 4 , line  204  represents the forward delay sequence, and line  206  represents the backward delay sequence. Line  220  represents estimated clock behavior with turning point detection (more accurate representation of true clock behavior). Through extensive experiments, it has been observed that this turning point identification is quite accurate. It finds the turning points very quickly, even in the event of quite noisy data. By using this algorithm, the present invention significantly improves the accuracy of the clock offset and skew estimations. 
   Presented below is a formal description of the algorithm: 
   1) set valid_solution=FALSE 
   2) while (valid_solution=FALSE)
         a. run the symmetric convex hull algorithm   b. turn_indicator=(rtt_min−rtt_estimate)/number_of_points   c. if (turn_indicator &lt;=rtt_std) or (number_of_points&lt;=2), then valid_solution=TRUE
           else, set starting_point equal to vertex identified by the symmetric convex hull algorithm   
               

   3) return the best offset, clock skew estimate. 
     FIG. 5  shows an example of the turning point identification algorithm. With the example shown in  FIG. 5 , only one point goes outside of the band between lines  304  and  306 . This means that it takes one observation to recognize the turning point and another point to adjust the local clock within range. 
   As will be readily apparent to those skilled in the art, the present invention can be realized in hardware, software, or a combination of hardware and software. Any kind of computer/server system(s)—or other apparatus adapted for carrying out the methods described herein—is suited. A typical combination of hardware and software could be a general purpose computer system with a computer program that, when loaded and executed, carries out the respective methods described herein. Alternatively, a specific use computer, containing specialized hardware for carrying out one or more of the functional tasks of the invention, could be utilized. 
   The present invention can also be embedded in a computer program product, which comprises all the respective features enabling the implementation of the methods described herein, and which—when loaded in a computer system—is able to carry out these methods. Computer program, software program, program, or software, in the present context mean any expression, in any language, code or notation, of a set of instructions intended to cause a system having an information processing capability to perform a particular function either directly or after either or both of the following: (a) conversion to another language, code or notation; and/or (b) reproduction in a different material form. 
   While it is apparent that the invention herein disclosed is well calculated to fulfill the objects stated above, it will be appreciated that numerous modifications and embodiments may be devised by those skilled in the art and it is intended that the appended claims cover all such modifications and embodiments as fall within the true spirit and scope of the present invention.