Abstract:
An apparatus is provided for recovering a reference clock generated by a master clock in a sender. The sender sends timing packets over a network. The apparatus comprises a controllable slave clock and a control circuit which determines the frequency drift between the master clock and the slave clock and controls the slave clock so as to reduce the drift. The error is determined as a function of (r×m×N)−C′ a (n+r×m),  
         where   ⁢           ⁢       C   a   ′     ⁡     (   n   )         =       (       ∑     i   =   0       q   -   1       ⁢       C   ′     ⁡     (     n   -   i     )         )     /     q   .           
N is the number of cycles of the master clock between the sending of consecutive timing information items, C′(s) is the number of slave clock cycles between receipt of the (s-rm)th and sth timing information items from the network, m is an integer greater than 0, q is an integer greater than 1, and r is a non-negative integer representing the order of the drift determination.

Description:
TECHNICAL FIELD  
       [0001]     The present invention relates to a method of and an apparatus for recovering a reference clock. For example, such a method and apparatus may be used in the emulation of a time division multiplexed (TDM) circuit across a packet network, such as an Ethernet, an ATM network or an IP network.  
       BACKGROUND  
       [0002]      FIG. 1  of the accompanying drawings illustrates a known circuit emulation arrangement used to support the provision of leased line services to customers using legacy TDM equipment. The service is provided between a first customer premises  1  and a second customer premises  2  and the connection is provided via a packet switched carrier network  3 .  
         [0003]     The premises  1  is the transmitting or sending end of the connection and comprises an apparatus  4  which contains a circuit  5  controlled by a “master” clock  6 . The circuit  5  receives customer data for transmission and organises this as a TDM transmission to the network  3 .  
         [0004]     The TDM link is a synchronous circuit with a constant bit rate governed by the service clock frequency f service  of the master clock  6 . The TDM link is connected to an arrangement  7  of the network  3  performing a provider edge interworking function. In particular, the circuit  7  converts the TDM data to data packets such as  8  and the packets are transmitted across the network  3  in accordance with the protocol of the network.  
         [0005]     A further apparatus  9  is provided at the receiving end of the network to perform conversion of the packets to a TDM link for the premises  2 . The regenerated TDM signals are then supplied to an apparatus  10  comprising an arrangement  11  for recovering the customer data controlled by a clock extraction circuit  12  supplying clock signals f regen , which are required to reproduce exactly the service clock frequency f service .  
         [0006]     The apparatus  9  comprises a queue  13  which receives and queues the packets received, over the packet switched network. A clock  14  supplies a clock signal at a frequency f regen  to a circuit  15 , which effectively controls the reconstituting of the TDM signals.  
         [0007]     In order for such an arrangement to operate correctly, it is essential for the regenerated clock frequency to match the master clock frequency in the apparatus  4 . However, packet switched networks have no synchronisation between nodes so that the connection between the TDM ingress and egress frequencies is broken. The consequence of any long-term mismatch in frequency is that the queue  13  will fill up or empty depending on whether the regenerated clock is slower or faster than the master clock. This results in loss of data and degradation of the service.  
         [0008]     The concept of adaptive clock recovery is known, for example from Circuit Emulation Services (CES) over ATM, ITU standard I.36.1 and ATM Forum standard AFVTOA-0078. However, details of actual techniques are not disclosed in these documents.  
       SUMMARY  
       [0009]     According to a first aspect of the invention, there is provided an apparatus for recovering a reference clock, generated by a master clock in a sender, from items of timing information sent by the sender over a network to the apparatus, comprising a controllable slave clock and a control circuit for determining each rth frequency drift between the frequencies of the master clock and the slave clock as a function of (r×m×N)−C′ a (n+r×m), where  
           C   a   ′     ⁡     (   n   )       =       (       ∑     i   =   0       q   -   1       ⁢       C   ′     ⁡     (     n   -   i     )         )     /   q         
 
         [0010]     N is the number of cycles of the master clock between the sending of consecutive timing information items, C′(s) is the number of slave clock cycles between receipt of the (s-rm)th and sth timing information items from the network, m is an integer greater than zero, q is an integer greater than one, and r is a non-negative integer representing the order of the drift determinations, and for controlling the slave clock so as to reduce the error.  
         [0011]     The network may be a non-synchronous network, such as a packet switching network with each timing information item being a packet.  
         [0012]     q may be less than or equal to m.  
         [0013]     The slave clock may be a voltage controlled oscillator.  
         [0014]     The control circuit may be arranged to adjust the frequency of the slave clock after each drift determination by: 
 
 x[ ( r×m×N )− C′   a ( n+r×m )]
 
 where x is a parameter determining the rate of drift compensation. 
 
         [0016]     According to a second aspect of the invention, there is provided a method of recovering a reference clock, generated by a master clock in a sender, from items of timing information sent by the sender over a network, comprising: determining each rth frequency drift between the frequencies of the master clock and a slave clock as a function of (r×m×N)−C′ a (n+r×m), where  
           C   a   ′     ⁡     (   n   )       =       (       ∑     i   =   0       q   -   1       ⁢       C   ′     ⁡     (     n   -   i     )         )     /   q         
 
         [0017]     N is the number of cycles of the master clock between the sending of consecutive timing information items, C′(s) is the number of slave clock cycles between receipt of the(s-rm)th and sth timing information items from the network, m is an integer greater than zero, q is an integer greater than one; and r is a non-negative integer representing the order of the drift determination; and controlling a slave clock so as to reduce the error.  
         [0018]     It is thus possible to provide a technique which allows accurate reference clock recovery across a network such as a packet switched network. In particular, such a technique provides compensation for long term frequency drift of a master clock and/or a slave clock. Thus, such a network may be used as part of a synchronous link which eliminates or substantially reduces data loss. 
     
    
     BRIEF DESCRIPTION OF THE DRAWINGS  
       [0019]      FIG. 1  is a block schematic diagram of a known arrangement for providing a TDM leased line service across a packet switched network;  
         [0020]      FIG. 2  is a block schematic diagram illustrating a method of and an apparatus for providing adaptive clock recovery constituting an embodiment of the invention;  
         [0021]      FIG. 3  illustrates the timing of generation and processing of a CES timing packet;  
         [0022]      FIG. 4  illustrates a moving gate measurement process; and  
         [0023]      FIG. 5  illustrates an accumulative moving gate frequency measurement process; 
     
    
       [0024]     Like reference numerals refer to like parts throughout the drawings.  
       DETAILED DESCRIPTION  
       [0025]      FIG. 2  illustrates an arrangement  20  at the sending end of a TDM leased line service. The arrangement  20  may be provided in the apparatus  4  at the customer premises  1  or in the arrangement  7  as part of the network  3 .  FIG. 2  also shows an arrangement  21  at the receiving end of the leased line service. The slave unit  21  may be provided in the circuit  9  of the network or in the apparatus  10  at the receiving premises  2 .  
         [0026]     The master unit  20  comprises a master reference oscillator  22  which forms a master clock supplying clock signals at a frequency f m . The clock signals are supplied to a counter  23  which divides the clock frequency by an integer and controls the generation of CES timing packets in a generator  24 . In particular, for every N cycles of the master reference clock, the generator  24  generates and sends a CES timing packet to the slave unit  21  via the packet network  3 .  
         [0027]     The received timing packets are supplied to a clock recovery control block  25  in the slave unit  21 . The output of the block  25  is supplied to a digital-analog converter (DAC)  26 , which supplies a control voltage to a voltage controlled oscillator  27  acting as the slave clock whose frequency f s  is to be synchronised to the master clock frequency f m . The output of the, oscillator  27  is supplied to a counter  28 , which supplies a “tick” count to the block  25 .  
         [0028]     The slave unit performs a packet receive event for every CES timing packet received and records the current value of the tick count driven by the voltage controlled oscillator  27 . The accumulated voltage controlled clock tick recorded for the nth CES timing packet, P n , is referred as c (n).  FIG. 3  shows the timing of the generation and processing of the CES timing packet by the master and slave units  20  and  21 .  
         [0029]     When the nth CES timing packet, P n , is received by the slave unit  21  and the number of CES timing packets received is more than m since the adaptive clock system was initialised, the accumulated voltage controlled clock ticks between the arrival times of P n  and P (n-m)  is equal to: 
 
 C ( n )= c ( n )− c ( n−m )  (1) 
 
 By taking into account the system operation latency variations and network latency variations under real operation conditions, C(n) can be expressed as: 
 
 C ( n )=( m×N )+Δ D   sys ( n )+Δ D   net ( n )− E   c ( n )  (2) 
 
 where: 
        (m×N) is the number of master reference clock cycles or ticks between the transmission times of P n  and P (n-m) ,     ΔD sys (n)=D sys (n)−D sys (n−m)=[D tx (n)+D rx (n)]−[D tx (n−m)+D rx (n−m)], 
            which is the variation in voltage controlled clock ticks caused by any system operation latency including time variations for transmitting and, receiving network packets,    
            ΔD net (n)=D net (n)−D net (n−m), 
            which is the variation in voltage controlled clock ticks caused by any packet traffic latency present in the network, and    
            E c (n) is the frequency error in voltage controlled clock ticks corresponding to the frequency differences between the master reference clock and the voltage controlled clock.        
 
         [0038]      FIG. 4  illustrates the concept of a moving gate measurement. An average voltage controlled clock tick count for q consecutive moving gate measurements, C a (n), is calculated as follows:  
                 C   a     ⁡     (   n   )       =     (         ∑     i   =   0       q   -   1       ⁢     C   ⁡     (     n   -   i     )         q     )             (   3   )                   C   a     ⁡     (   n   )       =     (               ∑     i   =   0       q   -   1       ⁢     [       (     m   ×   N     )     +     Δ   ⁢           ⁢     D   sys     ⁢     (     n   -   i     )       +                       Δ   ⁢           ⁢       D   net     ⁡     (     n   -   i     )         -       E   c     ⁡     (     n   -   i     )         ]           q     )             (   4   )               
         [0039]     Each C(n) is determined from the arrival times of two CES timing packets, P n  and P n-m . The packet arrival time information of any CES timing packet should not be used more than once in the calculation of C a (n). Otherwise, duplicated timing information is included in the average calculation and can lead to a less accurate result. This can be avoided by setting q to less than or equal to m.  
         [0040]     The variation of the frequency differences between the master reference clock and the voltage controlled clock is insignificant over the measurement period of C a (n), thus, E c (n)=E c (n−1)=E c (n−2) and so on. Therefore, C a (n) can be re-expressed as follows:  
                 C   a     ⁡     (   n   )       =     (             (     m   ×   N     )     -       E   c     ⁢     (   n   )       +                     ∑     i   =   0       q   -   1       ⁢     Δ   ⁢           ⁢       D   sys     ⁡     (     n   -   i     )           q     +         ∑     i   =   0       q   -   1       ⁢     Δ   ⁢           ⁢       D   net     ⁡     (     n   -   i     )           q             )             (   5   )             
 
         [0041]     Both system operation latency variations and network latency variations for the specific CES timing packet size are random. If sufficient timing samples are collected, then:  
             ∑     i   =   0       q   -   1       ⁢     Δ   ⁢           ⁢       D   sys     ⁡     (     n   -   i     )           q     -&gt;   0       
             ∑     i   =   0       q   -   1       ⁢     Δ   ⁢           ⁢       D   net     ⁡     (     n   -   i     )           q     -&gt;   0       
 
         [0042]     Hence, 
 
 C   a ( n )≅( m×N )− E   c ( n )  (6) 
 
 E   c ( n )≅( m×N )− C   a ( n )  (7) 
 
         [0043]     Both ΔD sys (n) and ΔD net (n) are independent of m, N and q. This means that the greater the values of variables m, N and q are set to, the better the frequency measurement results which will be produced.  
         [0044]      FIG. 5  illustrates the concept of accumulative moving gate measurements. The start of each gate P (n) , P (n+1) , P (n+2)  . . . , is fixed whereas the end of gate is extended by m packet arrivals between each pair of consecutive measurements.  
         [0045]     Using equations (3) and (6):  
                 C   a   ′     ⁡     (   n   )       =     (         ∑     i   =   0       q   -   1       ⁢       C   a   ′     ⁡     (     n   -   i     )         q     )             (   8   )             
 
         [0046]     For a first measurement, C′ a (n)≅(m×N)−E′ c (n).  
         [0047]     For a second measurement, C′ a (n+m)≅(2m×N)−E′ c (n+m).  
         [0048]     For a third measurement, C′ a (n+2m)≅(3m×N)−E′ c (n+2m).  
         [0049]     For an rth measurement, C′ a (n+r×m)≅(r×m×N)−E′ c (n+(r−1)×m).  
         [0050]     where E′ c (n) is the accumulative average voltage controlled clock error count measured at the arrival of packet n since the start of the accumulative moving gate. Long term error or frequency drift is compensated by correcting the slave clock frequency on the basis of these error values.  
         [0051]     The accumulative moving gate technique is designed to compensate long-term clock drift and should be used in conjunction with another clock recovery algorithm which can handle short-term clock drift, such as the technique disclosed in British patent application No. 0218103.0, the contents of which are incorporated herein by reference.  
         [0052]     The accumulative moving gate may be activated after the short-term clock recovery algorithm has achieved a reasonable accuracy. This means that, at the first measurement: 
        C 1   a (n)≅(m×N)−E 1   c (n) where E′ c (n)≅0 or is within an acceptable range.        
 
         [0054]     At the rth measurement, C′ a (n+r×m)=(r×m×N)−E′ c (n+(r−1)×m), where E′ c (n+(r−1)×m) is a measure of long-term clock drift over (r×m) master packet periods.  
         [0055]     In an illustrative example of this technique, the master clock frequency f m =2048000 Hz. The master unit  20  sends one CES timing packet to the slave unit  21  every one second so that N=2048000. Also, m=10, q=2, and the arrival times for the 1 st , 2 nd , 11 th  and 12 th  packets are 2048005, 4096009,.22528055 and 24576060, respectively, so that:  
                 E   c   ′     ⁡     (   n   )       ≅       ⁢       (     m   ×   N     )     -       C   a   ′     ⁡     (   n   )                     =       ⁢         (     10   ×   2048000     )     -     (           24576060   -   4096009   +               22528055   -   2048005           )       2                 =       ⁢     -   50.5               
 
         [0056]     If the arrival times for the 21 st  and 22 nd  packets are 43008189 and 45056242, respectively, then:  
                 E   c   ′     ⁡     (     n   +   m     )       ≅       ⁢       (     2   ⁢   m   ×   N     )     -       C   a   ′     ⁡     (     n   +   m     )                     =       ⁢         (     20   ×   2048000     )     -     (           43008189   -   4096009   +               45056242   -   2048005           )       2                 =       ⁢     -   208.5               
 
         [0057]     The overall clock drift between the 1 st  and the 22 nd  packets is therefore −208.5 clock cycles.  
         [0058]     If a long-term clock drift E′ c (τ) is detected at time, t, a frequency adjustment Δf vco =x×E′ c (τ) can be applied to compensate the clock drift. The value of x determines the rate of compensation for the detected long-term clock drift. In general, it is desirable to compensate long-term clock drift over a reasonably long period rather than introducing rapid changes that may interfere with the short-term clock recovery algorithm running in parallel. A typical frequency adjustment rate would be 5 times or more slower than the short-term clock recovery algorithm.  
         [0059]     When using the present technique, it is possible to switch off the short-term clock recovery algorithm running in parallel once the master and slave clocks are converged. This is, however, only possible if the master clock has very slow drift characteristic and high stability.