Abstract:
A synchronization module for providing synchronization messages to be sent with a time stamp in accordance with the PTP protocol of standard IEEE 1588 is provided. The synchronization module comprises a program module for generating a synchronization message to be sent and for providing the synchronization message with a first time stamp, and a hardware-implemented time stamp module which receives synchronization messages from the program module and forwards them in accordance with the PTP protocol. The time stamp module comprises a real time clock, a message detector for recognizing a synchronization message by its difference in relation to other messages and a message manipulator for overwriting the first time stamp in a synchronization message recognized by the message detector with a second time stamp actually retrieved from the real time clock.

Description:
CROSS REFERENCE TO RELATED APPLICATIONS 
     This application is the US National Stage of International Application No. PCT/EP2005/056193 filed Nov. 24, 2005 and claims the benefit thereof. The International Application claims the benefits of German application No. 102004061127.0 DE filed Dec. 16, 2004, both of the applications are incorporated by reference herein in their entirety. 
     FIELD OF INVENTION 
     The present invention relates to a synchronization module. 
     Stringent requirements are placed on the time synchronicity of components employed in distributed communication or data-processing systems. The clock generators of said components are frequently synchronized with each other via an asynchronous network through an exchange of data packets provided with time stamps, or with a reference clock generator accessible via the asynchronous network. 
     BACKGROUND OF THE INVENTION 
     What is termed the PTP protocol (PTP: Precision Time Protocol), which is defined in the IEEE 1588 standard (IEEE: Institute of Electrical and Electronic Engineers), is the protocol currently favored for synchronizing the clock and phase of clock generators via asynchronous networks. The cited standard basically makes a very high synchronizing accuracy possible. However, the hardware requirements for achieving said synchronizing accuracy are not precisely specified in the present version of said standard, namely “IEEE Std 1588™-2002, IEEE Standard for a Precision Clock Synchronization Protocol for Networked Measurement and Control Systems”, dated Nov. 8, 2002. 
     The references made below to said standard relate to the aforementioned version, whose disclosure content is deemed to be included in the present document on a reference-specific basis. 
     The achievable synchronizing accuracy has hitherto been limited owing in particular to what is termed a software jitter occurring while the time stamps are being provided and read by an IEEE 1588 protocol stack implemented by software means. Said jitter is due mainly to the unsteady processing sequence of the responsible protocol routines, which are generally disrupted by the operating system by numerous what are termed interrupts. Said software jitter is within the scope of the IEEE 1588 standard referred to also as protocol stack delay fluctuation. A synchronizing accuracy only in the order of 1 μs to 100 μs has in practice proved to be attainable in this manner. 
     SUMMARY OF INVENTION 
     While it is true that higher synchronizing accuracies can basically be achieved using a PTP protocol implemented by hardware means, said kind of hardware implementation also increases the costs several times. 
     An object of the present invention is to disclose a synchronization module that exhibits an implementation of the PTP protocol according to IEEE 1588 standard and by means of which higher synchronizing accuracies can be attained at relatively little cost. 
     Said object is achieved by means of a synchronization module exhibiting the features of the independent claim. 
     Advantageous embodiments and developments of the invention are disclosed in the dependent claims. 
    
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
       An exemplary embodiment of the invention is explained in more detail below with the aid of the in each case schematic drawings. 
         FIG. 1  is a chart illustrating different timestamp points and their latencies, and 
         FIG. 2  shows an inventive synchronization module. 
     
    
    
     DETAILED DESCRIPTION OF INVENTION 
       FIG. 1  is a chart from Section 6.2.4 of the known IEEE 1588™ 2002 standard document illustrating different timestamp points and their latencies. A message timestamp point illustrated there is an identifying feature of synchronization messages such as the PTP protocol&#39;s Sync and Delay_Req messages shown in  FIG. 1 . The message timestamp point can be identified if the relevant message passes through the clock timestamp point according to the PTP protocol.  FIG. 1  shows a typical Sync or Delay_Req message that traverses the PTP protocol stack for inbound data packets along the arrowed dashed line. The message timestamp point represented in  FIG. 1  by the first “11” bit pattern of the message after a series of leading “10” bit patterns passes through the clock timestamp point after an inbound_latency period after exiting the physical transmission medium. The above explanations are analogously applicable also to the timestamps and latencies of outbound synchronization messages. 
       FIG. 2  is a schematic of an inventive synchronization module. A time-critical portion of the IEEE 1588 standard, namely the timestamp function, is in the case of said synchronization module inventively implemented by means of a specific hardware timestamp module and not by software means. The hardware timestamp module is implemented as an autonomous component and has defined interfaces. By contrast, the IEEE 1588 standard&#39;s functionality residing on layers 2-7 of the OSI reference model is implemented using a standard-compliant program module which in particular generates synchronization messages requiring to be sent and provides them with time stamps subsequently to be overwritten by the hardware timestamp module. 
     The hardware timestamp module has the following function blocks: 
     Realtime Clock RTC: 
     A 32-bit counter having the counting variables “seconds” and “nanoseconds” in keeping with the PTP protocol&#39;s OriginTimestamp fields and hence of the PTP protocol&#39;s TimeRepresentation type. 
     Message Detector MD (for Synchronization Messages Requiring to be Sent and Received): 
     The message detector MD serves to recognize the PTP protocol&#39;s PTP_SYNC_MESSAGE and PTP_DELAY_REQ_MESSAGE synchronization-message identifiers and can store certain fields of recognized synchronization messages in the buffer FIFO. 
     The PTP_SYNC_MESSAGE and PTP_DELAY_REQ_MESSAGE message identifiers are recognized as follows:
     1. Recognizing and taking account of what are termed tags in the case of tagged frames   2. Recognizing a PTP_SYNC_MESSAGE and PTP_DELAY_REQ_MESSAGE by comparing the bit pattern of the serial bit stream with specific fields of Ethernet frames (for example UDP port  319  as what is termed the event port for PTP messages and the “control” field)   3. Reading the PTP fields: “control” and “sequenceId”   4. Storing said fields in the buffer FIFO   5. Storing the RTC timestamp registered at the “message timestamp point” instant.   

     Buffer FIFO (FirstInFirstOut Memory): 
     Example of its Contents: 
                                             Timestamp       Control   SequenceId   from RTC       (8 bits)   (16 bits)   (2 * 32 bits)                   0 (PTP_SYNC_MESSAGE)   100   0x12345678,               0x12345678       1 (PTP_DELAY_REQ_MESSAGE)   101   0x12345678,               0x12345678                    
Message Manipulator MM:
 
     The message manipulator MM can change values of certain fields of the synchronization messages recognized by the message detector MD. 
     The message manipulator MM can in the case of synchronization messages requiring to be sent overwrite the synchronization messages&#39; OriginTimestamp timestamp fields in each case with the current time value of the realtime clock RTC that was valid at the “message timestamp point” instant according to  FIG. 1 . The message manipulator MM then calculates the “UDP checksum” fields and the Ethernet CRC field and also overwrites said fields of the respective synchronization message. The timestamp field and checksum fields are overwritten on the fly, meaning with very little additional delay. By contrast, both a considerable delay and an irregular and hence scarcely compensatable jitter would occur were the timestamp function to be implemented by software means. 
     The IEEE 1588 2002 standard can for synchronization messages requiring to be received be optionally extended to provide additional “ReceiveTimestamp” fields for the SyncMessage and DelayRequestMessage messages. What is termed an “Extension Mechanism” for adding new fields or, as the case may be, messages is currently scheduled. The additionally provided ReceiveTimestamp field can in the case of received synchronization messages be written by the message manipulator MM with the current time value of the realtime clock RTC that was valid at the “message timestamp point” instant according to  FIG. 1 . The message manipulator MM then calculates the “UDP checksum” fields and the Ethernet CRC field and also overwrites said fields of the received synchronization message. That is done on the fly, meaning with very little additional delay. 
     The very slight delays and their broad constancy are in the case of the inventive synchronization module made possible in particular by the fact that the message detector MD and message manipulator MM have direct (hardware) access to the realtime clock RTC. 
     Message Timestamp Point Store MTP: 
     The message timestamp point store MTP stores a timestamp at the instant at which the physical interface&#39;s interface component PHY has recognized the preamble to a synchronization message. To initiate storing of the timestamp, the interface module PHY sends a signal to the message timestamp point store MTP or, as the case may be, hardware timestamp module. As soon as the message detector MD has likewise recognized the synchronization message it can use the instant at which said signal was sent and which was stored in the message timestamp point store MTP as the exact timestamp. 
     A jitter that would otherwise be caused by the interface module PHY can be largely avoided thanks to this arrangement. 
     Phase-Locked Loop PLL: 
     The realtime clock RTC is clocked by the “local clock” clock signal. That can be supplied from an external phase-locked loop PLL. The phase-locked loop PLL can optionally also be integrated as a function block. 
     The realtime clock RTC is coarsely adjusted by directly setting an initial value from the PTP protocol stack. The realtime clock RTC is finely adjusted by regulating the phase-locked loop PLL. 
     The procedure in the synchronization module is as follows for a PTP synchronization message requiring to be sent by the inventive synchronization module: 
     The synchronization message requiring to be sent is generated by the IEEE 1588 program module in the PTP protocol stack and passed on to the MAC layer (MAC: Media Access Control) via layers 4 and 3 (UDP/IP). The timestamp fields are entered by the IEEE 1588 program module as provided in the present IEEE 1588 2002 standard. When forwarded from the MAC layer to the interface module PHY via an MII interface (MII: Media Independent Interface), the synchronization message is decoded by the hardware timestamp module. If, when that is done, a Sync or DelayRequest message is recognized by the message detector MD, then the timestamp fields that were replaced by the IEEE 1588 program module will be replaced by the message manipulator MM with the current, highly accurate time value of the realtime clock RTC. The “UDP checksum” checksum and the Ethernet CRC field will additionally be updated. 
     The clock timestamp point shown in  FIG. 1  is generated by the hardware timestamp module directly at the message timestamp point. The inbound_latency and outbound_latency delays and the protocol stack delay fluctuation can thereby be reduced to a very small value. 
     The “local clock” clock signal&#39;s clock and phase accuracy is substantially improved in terms of jitter and maximum time deviation from the reference time source (clock master) for both what are termed “ordinary clocks” and what are termed “boundary clocks”. 
     Typical values for the protocol stack delay fluctuation depending on how the clock timestamp point is implemented are listed below: 
     
       
         
               
               
               
             
           
               
                   
                   
               
               
                   
                   
                 Protocol stack 
               
               
                   
                 Clock timestamp point: 
                 delay fluctuation: 
               
               
                   
                   
               
             
             
               
                   
                 Software timestamp on layer 7 
                 100 μs . . . 10 ms 
               
               
                   
                 Software timestamp on layer 2 
                 1 μs . . . 100 μs 
               
               
                   
                 Hardware timestamp according 
                 In the ns range 
               
               
                   
                 to the invention 
               
               
                   
                   
               
             
          
         
       
     
     Thanks to the synchronizing accuracies down to the nanosecond range that can be achieved, the way is paved for numerous new application fields for the IEEE 1588 standard. 
     A further advantage of the invention is to be seen in the protocol stack delay fluctuations being rendered largely independent of software influences. Said influences are due to, for instance, high or fluctuating processor-capacity utilization, interrupt blocking times, a high or fluctuating interrupt frequency, changing processor performance and/or the architecture of the interrupt controller. 
     It is also particularly advantageous that the protocol stack delay fluctuations are rendered largely independent of the hardware platform on which the PTP protocol is running (processor, hardware architecture). In contrast thereto, the protocol stack delay fluctuation changes considerably when a synchronization module according to IEEE 1588 2002, where the timestamp module is implemented by software means (layer 7 or 2), is ported to another hardware platform. 
     Very high synchronizing accuracies can be achieved at relatively little additional cost thanks to the functions being advantageously divided between the hardware and software, which is to say between the hardware timestamp module and IEEE 1588 program module. 
     The synchronizing accuracy can, though, be even further increased if the interface module PHY is clocked using the same “local clock” clock signal as the hardware timestamp module instead of by means of a separate clock generator. An inherent synchronicity between the interface module PHY and hardware timestamp module can be produced thereby. 
     Inventive synchronization modules can be employed both on a standalone basis as an ASIC (Application Specific Integrated Circuit), FPGA (Field Programmable Gate Array), or CPLD (Complex Programmable Logic Device), and in an embedded manner as a constituent of components of the physical layer (if the register I/F is used, for example MDI) or as a constituent of network processors.