METHOD FOR PROVIDING TIME SYNCHRONIZATION IN A NETWORK

Abstract: The present solution relates to a method for providing time synchronization in a network, especially in a Local Area Network (LAN), in which network, a node comprises a master time distributor designed for broadcasting clock information at regular intervals or on demand. In order to circumvent the problem of unpredictable delays, and thereby enabling a Very Accurate Time Synchronization, the present invention suggests a solution by defining one network event as a "tick", sending from one node such a tick at regular intervals or on demand, with one node being defined as the time synchronization master node, the master node (40), upon detection of such a tick, sends a message containing the tick arrival time to any node (41, 44, 45, 46) requiring time synchronization.

Description: Method for providing time synchronization in a network Field of the invention The present invention relates to a method for providing time syn- chronization in a network, especially in a Local Area Network (LAN), in which the network a (selected) node comprises a Master Time Distributor designed for broadcasting clock information on demand. Background of the invention A common problem in Local Area Networks (LAN) is the concept of Absolute Time. Even if one node is designated a role of Master Time Distributor and responsible for broadcasting clock information on demand, the medium access mechanism of LAN introduces an unpredictable delay to the transfer of time synchronization message. This delay can easily surpass the required precision of the Absolute Time, rendering the whole concept mean- ingless. In addition, the duration of the time synchronization message and the message handling delays in the receiving nodes introduce further uncertainties. Prior art From US 5 408 506 (Mincher et al.) there is a distributed time syn- chronization system and method, wherein some nodes will have their frequency amended in relation to a virtual master clock value. US 5 440 556 (Edem et al.) relates to a method wherein two circuits on each side of a network line are synchronized to the same reference clock by sending each circuit a 125μs pulse. US 5 602 922 (Danneels) relates to a system for synchronizing data transmitted from a server to a client, by initializing the clock when the first packet has been received and furthermore comparing the clock times with the packet time. This system may be relevant in connection with video, where time distances are relevant. US 5 544 324 (Edem et al.) relates to a network for transmitting isochronous data by using a frame structure having a variable number of time slots to compensate for timing variants between reference clocks and data rate. An example of an isochronous data sync is a video monitor which can receive a continuous stream of video data for display, and this prior art seeks to transfer such isochronous data in a more appropriate manner. WO 87/04306 (Ketzler/ETA Systems) relates to an electronic clock control system for digital data computers. The system comprises of a master oscillator distributing clock signals to a number of circuit cards for regulating the time delay to each circuit card. WO 93/04544 (Wray/Motorola) relates to a method for adjusting a synchronization signal with a received data signal by using an error signal which defines the difference between the two signals. WO 93/14570 (Bergstrόm/Asea Brown Boveri) relates to a method and device, used for tuning an internal generated clock pulse signal by using master and slave units in a FLL circuit. Summary of the invention The object of the present intention is to introduce a method of time distribution that will circumvent the problem of unpredictable delays, for thereby enabling a very accurate time synchronization. This object is based on a defined network event called a "tick". The requirement for such a tick is only that it can be transmitted on a network, and is unique and easily recognizable. Some possible tick candidates are: - One or more legal network addresses in the packet - One or more legal network group addresses in the packet - A legal packet with enforced code violation in the predefined part - A predefined sequence of bits ending in a code violation - A pulse of predefined length The object of the invention is achieved in connection with a method as of the type stated in the preamble, which according to the solution is char- acterized by a definition of a "tick", sending such a tick from one node at regular intervals or on demand, one node being defined as the time synchronization master node, and said master node, upon detection of such a tick, sending a message containing the tick arrival time to any node requiring time synchronization. A further aspect of the invention is a network, especially a Local Area Network (LAN), having a time synchronization arrangement in which in one node in the network is a time synchronization master node, the remaining nodes being time synchronization slave nodes synchronized with the master node, wherein at least one slave node in the network is arranged to send a synchronization tick on the network at regular intervals or on demand, the time synchronization master node which being arranged to, upon detection of such a tick from said at least one slave node, sending a message containing the tick arrival time at the master node to any node requiring time synchronization, any node requiring time synchronization is arranged to the receive the tick and the message, and to check the tick arrival time in the message against its the node's own stored tick arrival time and update the node's local clock by the difference between the local arrival time and the arrival time at the master node. The node which sends (broadcasts) the tick may be the master node or any one of the slave nodes. There are several advantages gained by the use of a slave node for sending the tick instead of the master node. Firstly, the processing load required at the master node will be reduced since the master node with the highest processing load and with no need of precise time synchronization does not have to process all ticks and is able to dedicate its processing power to primary functions. Receiving a tick from a slave node, the master node will send the time message containing the arrival time of the tick at the master node and being addressed to a all slaves, to a group of slaves, or to a specific slave node requesting the synchronization. Secondly, a slave node which has lost the synchronization is able to restore the synchronization more rapidly. Let us assume that a slave is reset and then booted up. If it is the master node only which sends the tick the delay between the booting up the slave node and receiving the tick and the associated time message and thereby the synchronization of the slave node may be relatively long. When the tick is send by the slave node after the reset, eg. In the end of the booting procedure, the synchronization is achieved as soon as possible, without need of waiting for master synchronization cycle. Thirdly, the slave nodes may have different requirements for time accuracy and thereby different cycle times of time synchronization. In case it is the master node which sends the ticks, the ticks will be sent to all the slave nodes with the cycle time of the node(s) having the most strict timing requirements. This results in unnecessary loading of the master node particularly and also the slave nodes with a less strict timing requirements. When each node, or one node in a group of slave nodes having similar timing requirements, is able to send the tick when required, i.e. at regular intervals or on demand, the loading will be optimized. By providing two or more different ticks it is possible to arrange the slave nodes into two or more groups having differ- ent timing requirements or loading situations, so that slave nodes in one group is not able to recognize a tick send by a slave node in another group. As a consequence, heavily loaded slave nodes having less strict timing requirements will not recognize a frequently sent tick of another group and will not waste time and processing capacity for unnecessary synchronization events. In one embodiment of the invention one slave node in a group of slave nodes is nominated as a time submaster node which synchronizes itself cyclically with the master node by means of the method according to the invention. The other slave node(s) in the group is (are) synchronized very ac- curately with the submaster node by means of the method according to the invention. This arrangement will still further decrease the loading of the master node. Further features and advantages of the present solution will appear from the following description of suggested embodiments, as well as from the appending patent claims. Brief disclosure of the drawings The invention will now be further described, with reference to the enclosed drawing. Figure 1 is a diagram illustrating the clock distribution sequence using conventional methods. Figure 2 is a diagram illustrating the time synchronization using the methods according to the present invention. Figure 3 is a block diagram illustrating an embodiment wherein the present invention can find its application, Figure 4 is a signalling diagram illustrating the time synchronization wherein a slave node sends the tick. Detailed description of the invention Firstly, reference is made to Fig. 1 which is a diagram illustrating the clock information distribution sequence using conventional methods. In Fig. 1 the numeral references herein mean: 1 Time Sync Master Software reads master clock, prepares time message 2 Time Sync Master Software puts the time message in transmit queue 3 Maximum allowable difference between local clocks 2-4 Time Sync Master waits for transmit permission 4 Time Sync Master transmits the time message and Time Sync Slave receives the time message 5 Time Sync Slave Software finished processing the received time message 6 Difference between Time Sync Slave clock and Time Sync Master clock. The problem with this prior art solution lies in the time interval from 2 to 4 - the period when a clock message is ready for transmission but the node has not yet gained access to the network. The length of this time interval is very hard to predict, as it depends on the bus access mechanism and the current state of the network. Next reference is made to Fig. 2 which is a diagram illustrating the time synchronization using the methods according to the present invention In Fig. 2 the numeral references therein mean: 1 Time Tick Master Software puts a tick in the transmit queue 2-4 Tick is queued, waiting for transmission 4 Tick is on the network medium and all Time Tick Slaves receive the tick 5 Time Tick Slave Software notes the local tick arrival time (T lt ), Time Sync Master Software prepares time message containing the master clock tick arrival time (T mt ) and puts it in the transmit queue 5-6 Message containing the absolute time (master clock tick arrival time) is queued in the Time Sync Master Node, waiting for transmission 6 Time Sync Master transmits the master clock time message on the network medium 7 Each Time Sync Slave receives the time massage (the receiving instant can be different from node to node) and updates its local time (T by the time difference between the recorded local tick arrival time and the received master clock time message (T., = " - " .,+ T mt - T, t ) . If we now look at Fig. 2, the situation is quite different when compared with Fig. 1. The tick does not contain any clock information. It is intended for all nodes that need absolute time update. The only important thing about the tick is that it should arrive at all such nodes with the same delay every time. When it arrives, each node stores the local time value on its arri- val. The Time Sync Master node then prepares a master clock time message containing the time when the tick arrived and transmits it on the network. When this message arrives, all nodes can check the master clock time against their own stored tick arrival time and update their local clock by the difference between the local arrival time and the master clock time. Basic principle The basic principle of the Very Accurate Time Synchronization system is that the time distribution procedure is changed from one-step to two- step. - A synchronization event (tick) is defined on the LAN. The only restriction on such a tick is only that it is unique and easily recognizable. The tick may also called a synchronization message. Some possible tick candidates are: - One or more legal network addresses - One or more legal network group addresses - A legal packet with enforced code violation in the predefined part - A predefined sequence of bits ending in a code violation - A pulse of predefined length - A synchronization event is detected in a specified position in the tick. The two-step time distribution procedure is as follows: 1. One node of the LAN is responsible for generating synchronization events at regular intervals or on demand. The detection of a synchronization event by LAN nodes is a time-critical element of the procedure 2. One node of the LAN is assigned the role of the Master Time Distributor. Whenever this node detects a synchronization event on the LAN, it records the time when the event was detected and broadcasts a message containing the recorded time to all nodes that require time synchronization. The transfer of this message is not time-critical. This approach eliminates the impact of the LAN medium access delay, but one still has to cope with the delay of processing synchronization events. This can be solved if every node that requires time synchronization fulfills some basic requirements. Requirements on LAN nodes Fig. 3 shows a block diagram of a Local Area Network node. Such a node must satisfy four requirements: 1. A raw data stream from the LAN interface 2 must be available. 2. A Time Synchronization Event Detector 3 that can detect a specified synchronization event in the raw data stream, must be added. 3. The node 1 must be able to maintain local time between time synchronization messages. 4. The node CPU or the local clock handling hardware must be able to react on the signal from Synchronization Event Detector 3. Very accurate time synchronization procedire If all nodes requiring time synchronization fulfill the requirements presented in the last paragraph, the procedure of very accurate time synchro- nization is as follows: 1. When a synchronization event is detected, the Synchronization Event Detector 3 notifies the CPU or the local clock handling hardware. 2. The local time for that event is recorded. 3. If the node is the time synchronization master, the recorded time is transmitted in a message to other nodes that require time synchronization. 4. All other nodes wait for the time message from the Master node. When this message arrives, the local clock is adjusted of a difference between the received time and the recorded time of the synchronization event occurrence. Using this procedure the time synchronization uncertainty is reduced to four very small components: - The transmission delay on the network medium. For almost all Local Area Networks this delay is below 10μs. - The resolution of the local clock hardware. This is usually well be- low lμs. - The difference in the detection of synchronization event. This can be equal to the resolution of the local clock or better. - The difference in the reaction time on the synchronization event detection. Even if the reaction time can be at the level of 40μs or more, the difference in the reaction time will usually be below Iμs.ln this way the Very Accurate Time Synchronization procedure approaches the theoretical limit (light speed) of time distribution over the LAN medium. The node which sends (broadcasts) the tick may be the master node or any one of the slave nodes. Fig. 4 illustrates a signalling diagram, in which slave 44 sends a tick on the network (not shown), i.e. to a master node 40 and other slave nodes 45 and 46. All slave nodes 44-46 will receive the tick and register a local arrival time of the tick. Receiving a tick from the slave node 44, the master node 40 will send the time message containing the arrival time of the tick at the master node 40 to the slave nodes 44-46. The slave nodes 44-46 check the tick arrival time in the message against the node's own stored tick arrival time and update the node's local clock by the difference between the local arrival time and the arrival time at the master node 40. In one embodiment of the invention one slave node in a group of slave nodes is nominated as a time submaster node 41 which synchronizes itself cyclically with the master node 40 by means of the method according to the invention, as shown in Fig 4. In other words submaster node 41 sends a tick on the network. Both master node 40 and the submaster node 41 will receive the tick and register a local arrival time of the tick. Receiving a tick from the submaster node 41 , the master node 40 will send the time message containing the arrival time of the tick at the master node 40 to the submaster node 41. The submaster node 41 checks the the tick arrival time in the message against the node's own stored tick arrival time and updates the node's local clock by the difference between the local arrival time and the arrival time at the master node 40. The other slave nodes 42 and 43 in the group are synchronized very accurately with the submaster node 41 by means of the method according to the invention. More particularly, in the example shown, slave 43 sends a tick on a network to a submaster node 41 and the other slave node 42. Both slave nodes 42 and 43 will receive the tick and register a local arrival time of the tick. Receiving a tick from the slave node 43, the submaster node 41 will send the time message containing the arrival time of the tick at the submaster node 41 to the slave nodes 42-43. The slave nodes 42-43 check the tick arrival time in the message against the node's own stored tick arrival time and update the node's local clock by the difference between the local arrival time and the arrival time at the submaster node 41. This arrangement will still further decrease the loading of the master node due to the decreased number of ticks to be processed. When the slave initiated synchronization according to the invention is employed, a slave node which has lost the synchronization is able to restore the synchronization more rapidly. Let us assume that a slave 44 is reset and then booted up in Fig. 4. If it is the master node 40 only which sends the tick, the delay between the booting up the slave node 44 and receiving the tick and the associated time message from the master node 40 at slave node 44 and thereby the synchronization of the slave node 44 may be relatively long. When the tick is send by the slave node 44 immeadiately after the reset, eg. in the end of the booting procedure, the synchronization is achieved as soon as possible, without need of waiting for the cyclical master synchronization cycle. The drawings and the description thereof are only intended to illustrate the idea of the invention. The invention may vary in details within the scope and spirit of the attached claims.

Claims: Claims 1. Method for providing time synchronization in a network, especially in a Local Area Network (LAN), in which network a node comprises of a master time distributor designed for broadcasting clock information at regular intervals or on demand, characterized by defining one specific network event as a "tick", - sending such ticks on the network from one node at regular inter- vals or on demand, - one node being defined as the time synchronization master node, and - said master node, upon detection of such a tick, sending a message containing the tick arrival time to any node requiring time synchroniza- tion. 2. Method as claimed in claim 1, characterized in that said tick is defined at the moment when the last bit of a particular set of network addresses is detected or when a specified bit sequence in a packet is detected or when a specified signal is detected on .the Local Area Network (LAN) me- dium. 3. Method as claimed in claim 1 or2, characterized in that a local node is adapted to receive a raw data stream from said network, especial a Local Area Network (LAN) through an appropriate interface. 4. Method as claimed in any of the preceding claims, c h a r a c - t e r i z e d in that said local node is adapted to communicate with a Synchronization Time Detector for detecting a tick in the raw data stream received from the network interface. 5. Method as claimed in any of the preceding claims characterized in that said local node is adapted to keep time between synchro- nization messages. 6. Method as claimed in any of the preceding claims, c h a r a c - t e r i z e d in that any LAN node(s) is(are) adapted to receive a Time Distribution Message plus the amount of time that has passed since the tick arrived. 7. A method as claimed in any of the preceding claims, charac- t e r i z e d in that one of the slave nodes being arranged to send the ticks at regular intervals or on demand. 8. A method as claimed in any of the preceding claims, characterized in that any one of the slave nodes being arranged to send the tick after a reset of the respective slave node. 9. A method as claimed in any of the preceding claims, charac- t e r i z e d in that the slave nodes have different requirements for time accuracy, each slave node or one of a group of slave nodes sends a tick to the time synchronization master node when needed. 10. A method as claimed in any of the preceding claims, characte rized in that one slave node is a time submaster node which synchro- nizes itself with the master node, and that at least one further slave node is syncronized with the time submaster node. 11. A network, especially a Local Area Network (LAN), having a a time synchronization arrangement in which in one node in the network is a time synchronization master node, the remaining nodes being time synchroni- zation slave nodes synchronized with the master node, characterized in that at least one slave node in the network is arranged to send a synchronization tick on the network at regular intervals or on demand, the time synchronization master node being arranged to, upon de- tection of such a tick from said at least one slave node, send a message containing the tick arrival time at the master node to any node requiring time synchronization, any node requiring time synchronization is arranged to the receive the tick and the the message, and to check the tick arrival time in the mes- sage against the node's own stored tick arrival time and update the node's local clock by the difference between the local arrival time and the arrival time at the master node. 12. A network as claimed in claim 11, characterized by any one of the slave nodes being arranged to send the tick after a reset of the re- spective slave node. 13. A network as claimed in claim 11 or 12, characterized in that the slave nodes have different requirements for time accuracy, and that each slave node or one of a group of slave nodes sends a tick to the time synchronization master node when needed. 14. A network as claimed in any one of claims 11-13, characterized in that one slave node is a time submaster node which synchro- nizes itself with the master node, and that at least one further slave node is synchronized with the time submaster node.

Inventors: HAEMYNEN KIMMO, KOZLOWSKI WOJCIECH, MARIANI MAURIZIO, VEFLING HARALD, HAEMYNEN, KIMMO, KOZLOWSKI, WOJCIECH, MARIANI, MAURIZIO, VEFLING, HARALD
Applicants: ABB RESEARCH LTD, HAEMYNEN KIMMO, KOZLOWSKI WOJCIECH, MARIANI MAURIZIO, VEFLING HARALD, ABB RESEARCH LTD., HAEMYNEN, KIMMO, KOZLOWSKI, WOJCIECH, MARIANI, MAURIZIO, VEFLING, HARALD
Application year: 1998
Main classification: H04L7
IPC codes: G06F1, H04J3