Abstract:
A method for controlling clocks in computer networks of a hierarchical structure includes the continual synchronization of the clock modules provided in the individual network levels to the time of a central master clock by means of messages. Time stamps are output from each clock module. Besides a time-of-day field and a date field, these time stamps contain additional information fields relating to synchronization source, synchronization type, synchronization delay, and time-of-day resolution.

Description:
This application is a continuation of application Ser. No. 07/991,681, filed Dec. 16, 1992. 
    
    
     BACKGROUND OF THE INVENTION 
     The present invention relates to a method for controlling clocks in computer networks of a hierarchical structure. 
     U.S. Pat. No. 4,584,643 describes a method for implementing a fault-tolerant clock control in distributed systems. All of the existing clocks in the network participate in establishing the system time: the mean value is generated from all their clock messages. This generally leads to a considerable amount of messages and places considerable demands on the communication means. There is a need for a system in a hierarchical computer network that can synchronize all of the individual computer clocks to a central control as well as identify when one of the clocks is out of synchronization. 
     SUMMARY OF THE INVENTION 
     These and other needs are satisfied by the method of the present invention. While the invention places moderate demands on the communication means given a system-wide clock control, it specifies a method which makes it possible to recognize the occurrence of various time bases in the system. This avoids the faulty linking of inconsistent clock messages. 
     In one embodiment, a central clock HU provides the time base for the synchronization messages that are sent to the master clock modules in the first level of the hierarchical computer network. These master clock modules send the synchronization message to the slaves and master clock modules in the level below. Each clock module forms a representation of its local time in the form of a time stamp, which contains information regarding time, date, whether it is slaved to a master (F0), which master it is slaved to (CLOCKNR), and if its master is synchronized to HU (F1). It further contains information on the largest variation in time between the clocks in its level (synchronization delay) and the resolution of its own clock (time-of-day resolution). This time stamp information is sent to a central evaluation unit AW for analysis. 
     The synchronization messages sent from the central clock HU to the master clock modules contain information fields virtually identical to those of the above described time stamps. Each clock module merely retrieves the fields corresponding to F0, CLOCKNR, F1, and places them into the appropriate fields of its time stamp and synchronization messages. The value inserted in the synchronization delay field is the sum of the synchronization delay in the levels above it and the synchronization delay inherent in its own level. The new synchronization message then is sent to the level of clock modules below, while the time stamp message is sent to the central evaluation unit AW. 
     The synchronization messages and time stamps described above further include a field representing the frequency with which the synchronization messages and time stamps are sent out of the clock module. 
     Information gathered from the method of the above embodiment is used to determine a minimum time interval in which events can be resolved. Two time stamps are compared to ensure they correspond to synchronized clock modules. If the clock modules are not synchronized the results are rejected as being incomparable due to inconsistent time bases. If the clock modules are synchronized, the sum, for each time stamp, is formed of the synchronization delay field and the time-of-day resolution field. The larger of the two sums is defined as the minimum time interval that two events can be resolved, hereafter denoted event resolution EA. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 illustrates an exemplary network configuration, in which an embodiment of the invention is employed. 
     FIG. 2 illustrates the received synchronization messages and the output time stamps for several clock modules of the configuration of FIG. 1, according to an embodiment of the present invention. 
     FIG. 3 is a flow chart for evaluating the time stamps of two clock modules. 
    
    
     DETAILED DESCRIPTION 
     FIG. 1 depicts a multi-microcomputer system having three hierarchically structured network levels E1 through E3, of which level E1 is the highest in the hierarchy. Clock modules provided in the individual computers--indicated by a clock symbol--are each synchronized by a clock module of the next higher level. A central master clock HU directly synchronizes the clock modules of level E1 and thus determines the time of day for the entire system. A master clock module is one that synchronizes the clock modules of the level beneath it. Each synchronized clock module which itself does not synchronize any clock modules of a level beneath it is called a slave. Masters M1 through M5 with their network-wide identifiers (CLOCKNR) and slaves S1 through S11 are present in the illustrated example. 
     A central evaluation unit AW is also provided. In this unit, the time stamps which are output by the clock modules are: registered, tested for time consistency, and the events which trigger them are ordered as a function of time (event ordering). 
     Assume that masters M3 and M5 are temporarily not synchronized with the master clock HU. This could be caused by a lack of synchronization messages or by the restarting of their computer. Then the master clock modules M3 and M5 would be free-running, with the result that their times of day are no longer consistent with those of the remaining system. They thus establish separate time bases. 
     The following synchronization parameters apply for the three network levels: 
     
         ______________________________________           E1      E2     E3______________________________________Synchronization cycle [sec]             60        10     1Clock resolution [msec]             10        10     1Synchronization delay [msec]             1.2       0.5    0.2______________________________________ 
    
     The synchronization cycle is the time interval between the synchronization or clock messages; the clock resolution is the externally observable time raster step with which the clock module counts time; and the synchronization delay is the maximum asynchronism that can occur within a hierarchical level between two clock modules. The synchronization delay is essentially determined by the product of the synchronization cycle and the quartz tolerance of the clock module. 
     With respect to the slave clock modules S1, S3, S4, S9 and S10, for the above described scenario, FIG. 2 shows the contents of the additional information fields. The left column, denoted by TEL, portrays the information fields of the synchronization messages received from these clock modules. The right column, denoted by ST, portrays the information fields of the time stamps output by these clock modules. One should think of the messages as well as the output time stamps as being supplemented by corresponding fields for time of day and date. These are not shown, however, for the sake of clarity. 
     The synchronization source field, described as CLOCKNR, contains information about the synchronization source, i.e., the identifier of the particular master from where the received message originated. Therefore, it is always the identifier of the highest synchronized master. Thus the CLOCKNR field of slave S9 is CLOCKNR=1 rather than CLOCKNR=4. If a master clock module is unsynchronized, or if it is free-running, then its slaved clock modules are synchronized to it but not to HU. Thus their CLOCKNR fields display the unsynchronized master&#39;s CLOCKNR, and not necessarily that of the master in the highest (El) level. As such the CLOCKNR field of slave S10 is CLOCKNR=5 rather than CLOCKNR=2. The field characterized by CLOCKNR always contains the identifier of the highest prior synchronization source. 
     The synchronization type field, designated as VERS, has three subfields for the synchronization message and four subfields for the time stamps output. The subfield denoted by F1 is characterized by T (=true) if the synchronizing master clock module is synchronized to the central master clock HU. It is set to the value F (=false) if it is &#34;free-running&#34; with its own time base. 
     When the subfield F1 is set to the value T, F2 signifies whether the master clock HU outputs daylight savings time (T) or standard time (F). In the case that F1=F is entered, the VERS field&#39;s far right subfield characterizes the current number of the active free-running phase of the master. This is the third subfield in the case of the synchronization message, and the fourth subfield in the case of the time-of-day stamp. Its contents indicate how many times the master synchronizing this slave was already forced to autonomously determine the time of day of the clock modules arranged downstream from it. This may occur because of a wanted or unwanted uncoupling from the master clock due to failure, for example, of the synchronization messages or other malfunctions. In this case, it broadcasts the synchronization messages to its subordinate hierarchical levels and enters its own identifier in the CLOCKNR field. In the scenario described, the third subfield of the VERS field of the slave clock modules S4 and S10 show that the master clock modules M3 or M5 (which synchronize them) have shifted into a free-running phase. Therefore, the number contained in the fourth subfield of the VERS field can be interpreted as the current number of a newly established time base, which relates to the particular higher-ranking synchronizing master. 
     The subfield denoted by F0 is an extension of the VERS field for the time stamp. Each clock module sets this subfield to the value T (true), when it is synchronized to a higher-ranking master clock module. 
     Of particular importance is the synchronization delay field denoted by SLAG, which indicates the synchronization delay. Each master clock module adds the synchronization delay that is relevant for its hierarchical level to the synchronization delay broadcasted to it in the synchronization message. Thus, the values of the synchronization delay in the individual hierarchical levels accumulate in this field. Thus, the SLAG field of the message received from the slave clock module S1 reveals the value of 1.2 msec, while the SLAG field of the message received from the slave clock module S9 shows the value of 1.7 msec, in accordance with the sum of the synchronization delay (1.2 msec) existing in the level E1 and the synchronization delay (0.5 msec) inherent in level E2. The value of the SLAG field in the time stamp is calculated by each clock module from the sum of the SLAG field in the message that it has received and of the value of the synchronization delay that is inherent for its hierarchical level. This becomes clear from a comparison of the SLAG fields from the received message and from the time stamps output for the individual slaves. 
     In the field denoted by SCYC, the messages intended for the clock modules show the time interval in which the synchronization messages are sent (synchronization cycle). This value is important for the clock module&#39;s calculation of the synchronization delay. It is also used to check (in the clock module) the synchronization and regularity of the received messages. Using this, it is possible to recognize when a master clock module has failed. 
     Finally, in the field denoted by GRAN, the time-of-day resolution is entered. The sum of the value input in this field and the accumulated synchronization delay input (in the SLAG field) determine the event resolution of one clock module. In this context, event resolution is understood to be the minimum interval that two time stamps must be separated for the events characterized by them to be brought into a clear time sequence, in the sense of which event occurred first in time. Characterized in this manner, the event resolution is also the maximum differential error which can occur when time intervals are calculated between two time stamps. 
     Using a flow chart, FIG. 3 shows how the additional information of a first and second time stamp, ST1 and ST2, from different clock modules is used for a consistency check and for a subsequent determination of the event resolution in this synchronization scheme. First, it is checked whether the subfields F0 of the two time stamps are set to the value T (301). If they are not, the two time stamps are rejected as being inconsistent, and the error message INC is output (302). This is because no statement can be made on the basis of different time bases about which time stamp characterizes the earlier or the later event. Then, it is checked if the subfields F1 have the value T in both time stamps (303). If so, it is checked to see if the subfields F2 of the two time stamps ST1 and ST2 have the same value (daylight saving time or standard time) (304). If so, the consistency test is successful. If not, the results are rejected as inconsistent (305). If both subfields F1 are not set to the value T, for example, when both clock modules are synchronized to the same free-running master, it is then checked whether the fields CLOCKNR and VERS of the two time stamps conform (306). If not, the two time stamps are again rejected as being inconsistent (307). On the other hand, if they do conform, the event resolution EA of the two time-consistent time stamps is determined (308). This is obtained, in each case, from the larger of the sums of the values in the GRAN and SLAG fields for the two time stamps. 
     Applying this flow chart to the embodiment of FIG. 2 reveals, that using the method according to the invention, it is possible is conclusively determine time-consistent time stamps and event resolution. A continual synchronization of local clock modules to a central master clock is achieved over several hierarchically structured network levels.