TIME SYNCHRONIZATION IN COMPUTER NETWORK

Abstract: A method for improved Network Time Protocol time synchronization in a computer network (1) where the computer network comprises a time client (2) and a timeserver (3). To eliminate network access errors at the client side, the actual time of leaving is stored in the time client (2) as a special time stamp (T11) and later substituted for T1 in the calculations. To eliminate network access errors at the server side, the time request packet is duplicated and returned twice, the second time containing the time stamp when the first packet left the server (T31). To eliminate network transversal jitter when using a switched network, a packet with a multicast is used and the time stamp (T11) is taken when the time request packet is reflected back from the switch and (T31) is taken when the reply packet is reflected back from the switch.

Description: TIME SYNCHRONIZATION IN COMPUTER NETWORK Field of the invention A method for enhanced accuracy Network Time Protocol time synchronization in a computer network, such as a local area network comprising a time client and a timeserver. Background of the invention The IETF (Internet Engineering Task Force group) Network Time Protocol (NTP) standard RFC 1305 defines a method for synchronizing workstation clocks across the Internet. This method has an accuracy of about 1 ms (millisecond) , which is adequate for time stamping files and other non- real-time operating system chores. Certain classes of automation systems, the most notable being Substation Automation, i.e. the control and protection of energy distribution network nodes, require much more precise time synchronization, for example, lμs for class 1 applications and 25μs for class 2 applications. A class 1 application is, for example, time tagging of syncrophasors and a class 2 application is, for example, time tagging of phasors. The RFC 1305 standard comprises an algorithm for calculation of the corrections to a time-of-day clock in one node, such as a time client, relative to a reference time-of-day clock in another node, such as a timeserver. The algorithm is based on a network packet, from now on called a time-request packet, containing three important time stamps : Tl { Origina te Timestamp) : The time the time request packet was generated in the client asking for the current time . T2 (Receive Timestamp) : The time the time request packet arrived at the timeserver. T3 { Transmit Timestamp) : The time the time request packet was updated and put into a transmission queue at the timeserver . In addition, the calculations require: T4: The time the time request packet arrived back at the time client. T2 and T4 are easily determined with accuracy down to microseconds, and sometimes even more accurate, using hardware or software time stamps based on network packet arrival interrupts. Accurate determination of Tl and T3 is, however, a problem. For full accuracy, Tl and T3 should be the time when the network packet leaves the time client or the timeserver. The problem is that Tl and T3 are not available until the network packet has already left the timeserver or time client and then it is too late to incorporate them into the packet. Therefore, the largest part of the time synchronization inaccuracy for an NTP setup is the variation in the delay between Tl and the actual time the network packet leaves the time client, as well as the variation in the delay between T3 and the actual time the network packet leaves the time server. Summary of the invention The object of the invention is to provide a method for Network Time Protocol (NTP) or Simple Network Time Protocol (SNTP) time synchronization in a computer network, without the disadvantages mentioned under background of the invention. This object is achieved by a method according to the independent claim 1. The invention provides a method where the accuracy of the time stamps involved may be substantially increased while still being compatible with the original protocol. In one embodiment of the invention, the computer network is a Local Area Network (LAN) and uses the Internet communications protocol suite, usually denoted TCP/IP. According to another preferred embodiment, the invention is used in control and protection of an energy distribution network node for improving time accuracy in the Network Time Protocol. According to another preferred embodiment of the invention, the Network Time Protocol is extended in a backwards-compatible way such that accuracy in the order of lOμs or better may be attained. Brief description of the drawing Fig. 1 is a schematic block diagram of a computer network, such as a LAN, comprising a time client and a timeserver where a time request packet is transmitted between the time client and the timeserver. Fig. 2 is a schematic block diagram of a computer network, such as a LAN, with a store-and-forward and/or switching device arranged between the client and the server. Detailed description of preferred embodiments Figure 1 shows a schematic block-diagram of a computer network 1, such as a Local Area Network (LAN) , comprising a time client 2 and a timeserver 3. A time request packet 4 is transmitted between the time client and the timeserver. The computer network protocol used is the Internet communication suite, usually denoted TCP/IP. The two main sources of inaccuracy that plagues the standard NTP method are reduced with the method described below. The method is concerned with a first and a second part of the algorithm in the standard NTP method, which will be described in the following. The algorithm is based on the time-request packet, containing three important time stamps: A first time stamp Tl: The time the time request packet was generated in the client asking for the current time. A second time stamp T2 : The time the time request packet arrived at the timeserver. A third time stamp T3: The time the time request packet was updated and put into a transmission queue at the timeserver . The first main source of inaccuracy is the variation in the delay between the first time stamp Tl and the exact time when the time request packet leaves the time client. To improve the time client accuracy the following steps are performed: 1. Create an NTP time request packet 4 and fill in the first time stamp Tl. 2. Transmit the time request packet to the timeserver 3. 3. Get hold of the actual time stamp, hereinafter called the fourth time stamp Til, when the time request packet leaves the time client 2, using the network transmit interrupt or a hardware time stamp. 4. Store the fourth time stamp Til in a data structure in the time client together with the first time stamp Tl.The timeserver 3 receives the time request packet 4 and transmits it back to the time client 2 5. Replace the first time stamp Tl in the time request packet by the fourth time stamp Til, when the time request packet 4 returns from the timeserver., This exchange eliminates the inaccuracy associated with the originate timestamp Tl in the time calculation and thus an improved NTP time client is achieved. This corresponds to the first part in the algorithm. The second main source of inaccuracy is the variation in the delay between the third time stamp T3 and the actual time the packet leaves the timeserver 3. To improve the timeserver accuracy, the following steps are preformed: 1. Create a duplicate packet 5 before entering the third time stamp T3 into the time request packet, when the time request packet arrives at the timeserver 3. This packet will hereinafter be denoted the time correction packet 5. 2. Transmit the time request packet 4 back to the time client 2. 3. Acquire an accurate time stamp, hereinafter called the fifth time stamp T31, when the time request packet leaves the timeserver, using the network transmission interrupt or a hardware time stamp. 4. Put the fifth time stamp T31 into the third time stamp T3 location in the time correction packet. 5. Transmit the time correction packet back to the time client . Now, the returned time request packet 4 has the standard NTP inaccuracy in the third time stamp T3. However, if the third time stamp T3 in the returned time request packet 4 is replaced by the fifth time stamp T31 from the time correction packet 5, the accuracy of the time stamps in the resulting packet will be: • Tl: Maximum if the substitution described in the first part of the algorithm is performed. • T2 : Maximum always . • T3: Maximum if the substitution described in the second part of the algorithm is performed. In this way network access jitter is eliminated and only network transmission jitter is left. Compa tibili ty wi th Network Time Protocol If an improved NTP time client connects to a standard NTP timeserver, only one packet will be returned, i.e. the time request packet. The improved time client executes the first part of the algorithm eliminating the first time stamp Tl inaccuracy. The resulting accuracy will therefore be better than standard NTP. If a standard NTP client connects to an improved NTP time server, it will get two time packets from the time server, i.e. the time request packet and the time correction packet, both of these having standard NTP accuracy. If the first packet is received successfully, the time will be updated according to the contents of that packet and the second packet will be discarded as an unnecessary duplicate. If the first packet is lost, the time will be updated according to the contents of the second packet. The second packet contains the T31 timestamp which, taken by itself, is a T3 timestamp with standard NTP accuracy. Reducing network transmission jitter In the case of a standard Local Area Network, the difference between the time stamp taken when the time request packet 4 leaves the client (server) transmitter and the time stamp taken when the same packet arrives at the server (client) receiver varies very little between transmissions. In the case where a store-and-forward and/or switching device 6 are/is in the path between the client and the server as in switched Ethernet, this difference will vary according to the traffic load at the time. Therefore, a store-and-forward and/or switching device 6 will introduce an unpredictable jitter in the packet travel time between transmitter and receiver. One way of reducing this jitter is to use broadcast or multicast packets as time request packets, between the time client 2 and the timeserver 3, together with a full duplex link to the store-and-forward device and/or switching device. The store-and-forward device and/or switching device will then be forced to forward this multicast packet to all connected nodes, usually with a time difference below one microsecond. In particular, the packet will be sent back to the originator, i.e. the time client or server, at a time very close to the time it is sent to the destination, i.e. the timeserver or client. This feature enables the originator to time stamp the reflected packet with a time stamp closely connected to the time the packet was sent to the destination from the store-and-forward device, eliminating the store-and- forward jitter. Figure 2 shows an example of how to reduce the network t\- o <-n o C-π o <_π t-n P- CΛ CΛ l-l P- < Hi o- ι-3 n H- su H cn rt c P- ι-3 Ό p- rt H P- ι-3 Qa o C rt rt rt P- s; Ό rt CU rt 3 rt rt 3 3 Cu H- O Φ tr o t) φ rt O cn Λ (-0 CU rt P- tr 3 tr Φ tr tr tr tr CΛ P- CU P- 3 hi rt Cu OJ Ό l-l Hi hi CΛ φ Hi Hi O P- n 3 Φ P- <! P- Φ Φ Φ Φ rt O 3 Q. 0 ) CD 3 3 0 ) H P- Hi o H rt P- hi rt t. CΛ P- ? CU φ rt CΛ P- Φ 3 X. tr Φ " . 3 hi Ό TJ O 0J Φ H l-i rt Φ tr Hi Φ Φ tr ιQ Φ 3 Φ l-i cn rt tr n 3 cn ■s, rt φ Φ cn O CΛ H P- Ό < rt hi . P- P- O Φ rt O 1 Φ 3 rt rt l-i Φ P- Φ Hi Φ rt rt rt CU P- 3 cu rt Φ hi 3 3 m 3 l-l P- P- Φ - σ 3 rt tr rt u Cu rt O P- l-i 3 O - tr O 3 Φ hi P- Ό ω X3 φ 3 o 3 Φ φ μ- rt Φ ti rt c-π < < Φ o 3 Hi Φ hi φ hi Hi < ω tn et l- 1 Hi X} 3 O tr Q- o tr rt P- 3 tr rt Φ Φ H P- ι-{ Φ rt CΛ u P- Φ ■ n O Φ CΛ Φ Φ o ti 1- * - P- 1 3 C Cu tr P- CΛ l-i l-i P- rt rt O hi 1 o Φ rt 13 P- hi P- P- 0 P- Hi hf rt Hi tr H 3 tr Hi Φ H o cn Φ Φ tr 3 Φ CU hi Φ cn CΛ rt 0 l-l CΛ l-i tr Hi P- o Φ H- J α Φ Cu O rt tv CU P- X. 3 p- X5 3 rt <l 0- rt ) O 3 rt Φ φ H CΛ Hi Φ fu O M o P- rt O rt cn 3 rt rt CΛ rt 3 tr φ • X . tr tr •n t O Φ o ti o rt CΛ w O rt P- H Φ P- tr Φ 1 Φ hi rt Φ CU P- ι_ι. • < φ Φ 0 ) 3 rt hi rt ? P- rt CU P- CU O 3 Φ rt CΛ cn rt 3 CΛ Φ CΛ Hi ι-3 P- 3 3 3 P- •X Φ o tr n Φ Φ 3 Cu rt l-i Φ cn φ CU tr rt rt O Φ rt rt o rt 3 tr 3 Φ X} rt 3 Hi Hi J3 o rt s u ^ H- rt Φ 3 O ti rt rt rt φ CU X. CU cn h P- CΛ Φ φ hi rt cn o o f_r 3 tr rt I- * cn 13 rt tr l-i Φ 3 13 Φ cn 3 rt 13 s: 3 P- CU rt Q. Φ P- I-! e O l-l Φ o P- (_π CΛ rt • O φ φ α rt 13 CU t rt 13 O f CU φ 3 rt CΛ rt tr Φ hi 3 3 hi Cu CU c • CU rt ι-3 tr Φ H Λ P- Φ n tr CD Φ ι-i O hi cn X. P- rt Φ Φ < 5 φ rt P- o o H h-* Φ σ 0 ) C ω Φ rt rt C tr 3 Qa X φ 3 α Φ ΪX α Φ 3 (U P- ti3 • < CU CΛ CU • 13 3 ι- > P- tr tr P- Φ Φ Φ φ H 13 I Φ hi CU Φ 3 rt o tr CU Φ • O rt φ P- Ό • rt o Φ H 3 CΛ Hi n • rt s: CU rt Qa < 13 P- P- φ Φ Φ er 3 O P- cn P- φ o φ rt o Φ P- • s Hi P- 3 Φ Φ 3 hi 3 3 3 α P- P- rt 3 rt 3 3 rt rt H 1-3 3 rt PJ H H rt rt p- rt P- < hi • ^ 3 Φ Hi Φ σ . (D rt 3 H tr •X. LT o H ω tr Φ cu P- o 13 Φ < tr tr rt I— 1 tr 1 CΛ P- H X3 I— 1 rt rt tr Φ O U Φ cn u P- cn ti 3 o CU Φ CU tr Hi o rt 3 tr o P- tr p- Φ Hi rt rt rt ti CΛ Φ Φ cu P- O Φ l-i rt rt P- rt O hi φ rt P- Φ O Φ h- 1 CΛ Φ o l-l n P- CΛ r P- o CΛ O H CΛ φ f 3 tr rt cn tr H Φ tr O CΛ o P- C rt rt O rt Φ t-t- 3 o Hi < O H rt 3 Φ rt (_ Φ P- tr Φ s, Hi cu Φ Cu rt hi rt Φ P- cn rt P- CU tr 3 O 3 rt H- CU P- Φ h Φ rt rt Φ • CΛ Φ cn a 3 CΛ hi P * 3 3 rt CD 3 3 Φ cn hi rt rt tr rt rt Hi H Λ [U • li CΛ rt Hi hi Φ rt rt 13 Φ 3 rt O Ό Φ P- P- Φ rt H- rt n C Hi P- --, φ rt Hi O o O P- (U CΛ Φ rt H CU P- 1 3 3 Φ O tr • s « Φ l-i ι-3 3 O n ι-i P- l-i 3 rt o 3 O O 13 o tr Φ t H 3 H CU Φ •XI cn ti tr P- CΛ H O tr iQ o u l-i Φ H CU Φ 13 Φ hi ? O n • Φ 1 cu 3 I- 1 Φ 3 CU rt Φ rt rt Φ 3 Φ 3 3 cn 0-. rt 3 Qa Φ 3 P* CU I-! φ l-> Φ α o Hi 3 rt H- P- H O CΛ rt CΛ rt tr Q. Cn hi tr rt Qa P- ι-3 13 3 α rt 3 Φ 1 o t- 1 φ O 3 3 Φ tr Ό CΛ rt rt tr rt 3 P- ^ tr Φ l-i P- φ tr CU • s s: o rt I-* Hi l-l 1— ' φ P- Cu • tr P- φ tr rt p- rt 3 rt o Hi P- X3 o P- 3 3 Φ rt 1 Cu o l-l P- P- o l-l cn rt rt P- t ( O Φ 3 Φ P- rt P- P- hi o rt 3 cu Λ X. rt tr Hi ι-( l-i O 3 l-l φ Hi £ tr tr CΛ rt ιQ Ps- o Φ rt 3 rt 3 U 3 ? o Φ Q. rt o CD .*r rt 3 P- • s n o tr Φ Φ rt Φ tl rt tr rt Φ Φ Φ Φ cn tr CΛ O rt rt P- tr hi tT 3 CU rt l-l ω CU P- rt p- l-i P- P- Qa rt t Φ rt • rt P- rt Cu hi O fu 3 φ r (U hi H- rt rt rt z. 3 Λ Φ rt 3 Φ I-. 3 cn cn u CΛ P- O 3 CΛ CU 3 Φ rt CU P- hi t rt o ι-3 H- H- P- T- Ό tr φ Λ α Φ rt rt rt rt rt rt X. 13 rt 3 rt Qa -S hi 3 CU Hi Φ Φ 3 I— 1 rt 3 3 Λ P- C φ CΛ C Cu O CU Cu CU O rt Cu CΛ tr hi Φ Φ α 3 P- α . Φ φ P- rt o cn Φ Φ rt o 3 3 3 tr tr O CU 3 Φ p- Φ Φ h( CΛ Hi rt ** u rt cn CU φ cn s: l-i cn p- o 13 rt 13 CΛ 13 P- φ Φ f Q. P- CΛ X. 3 Qa . 3 rt P- i- * ι-3 ti H- o 3 • Φ CU < rt 3 H tr rt 3 <! Φ rt rt 3 φ H- tr 3 Hi U tr Qa O H cn TS cn * φ φ l-i ι-3 Φ m H ι-3 X . rt P- rt hi rt P- CΛ Φ rt < rt Φ 3 -< Φ ti H- rt Φ cu l-i Ό Φ M 3 P 1 P- 0 Φ Φ 3 rt CΛ tr P- rt hi Hi CΛ Φ O ti rt er - CU CΛ n • O p- 3 φ 13 CΛ φ Cu rt Φ o P- rt > 3 H Qa tr cu O rt rt ≤ rt . Φ ^. £U CΛ 3 Φ 3 tr h-> CU rt Φ • s Φ n .V CU P- tr 3 CΛ • rt P- 13 φ Φ CΛ P- p- ? Φ o Φ l-i Cu CΛ O rt Φ hi rt CΛ rt 3 3 Φ 3 φ o CL tr CΛ 3 Before the calculations of the correct time, the time request packet 4 is also time-stamped with a sixth time stamp T4 (not shown) as it arrives back at the time client .

Claims: Claims 1. A method for Network Time Protocol time synchronization in a computer network (1), the computer network comprising a time client (2) and a timeserver (3) , the method comprising the steps of generating a time request packet (4) in the time client, - time-stamping the time request packet with a first time stamp (Tl) corresponding to the time the time request packet is generated, transmitting the time request packet to the time server, - time-stamping the time request packet with a second time stamp (T2) when it arrives at the time server, time-stamping the time request packet with a third time stamp (T3) when it is sent back to the time client, c h a r a c t e r i z e d b y the steps of - storing the actual time the time request packet (4) leaves the time client (2) as a fourth time stamp (Til) in the time client (2), after the step of time stamping the packet with the first time stamp (Tl) in the time client, and - replacing the first time stamp (Tl) in the time request packet by the fourth time stamp (Til) when the time request packet has returned to the time client, in order to improve the time client accuracy. 2. A method according to claim 1, c h a r a c t e r i z e d i n that the computer network (1) is a Local Area Network (LAN) . 3. A method according to claim 1 or 2, c h a r a c t e r i z e d b y the steps of duplicating the time request packet (4) into a time correction packet (5) in the time server (2), time-stamping the time correction packet with the actual time the time request packet leaves the time server in the form of a fifth time stamp (T31), transmitting the time correction packet (5) back to the time client (2), and replacing the third time stamp (T3) in the time request packet by the fifth time stamp (T31) from the time correction packet. 4. A method according to claim 1, where a store-and- forward device and/or a switching device (6) are/is in the path between the time client (2) and the timeserver (3) , c h a r a c t e r i z e d b y using a multicast or broadcast address for the time request packet (4) when transmitting the time request packet to the time server such that the time request packet is reflected to the time server from the store- and-forward device and/or switching device, and - time-stamping the fourth time stamp (Til) in the time client (2) as the reflected time request packet returns to the time client (2) from the store-and-forward or switching device (6). 5. A method according to claim 4, c h a r a c t e r i z e d b y the steps of duplicating the time request packet (4) into a time correction packet (5) in the time server (2), - time-stamping the time request packet with a third time stamp (T3) when it is sent back out using a multicast or broadcast address time-stamping the time correction packet with the actual time the time request packet was reflected back to the time server in the form of a fifth time stamp (T31) transmitting the time correction packet back to the time client (2) and replacing the third time stamp (T3) in the time request packet by the fifth time stamp (T31) from the time correction packet. 6. A Method according to any of the preceding claims, c h a r a c t e r i z e d b y time-stamping the fourth time stamp (Til) or the fifth time stamp (T31) , either in a network transmit interrupt or by using a dedicated hardware timer. 7. Use of the method according to any of claims 1-6 for control and protection of an energy distribution network node .

Inventors: JOHANNESSEN SVEIN, LOEKSTAD TROND, SKEIE TOR, JOHANNESSEN, SVEIN, LOEKSTAD, TROND, SKEIE, TOR
Applicants: ABB RESEARCH LTD, JOHANNESSEN SVEIN, LOEKSTAD TROND, SKEIE TOR, ABB RESEARCH LTD., JOHANNESSEN, SVEIN, LOEKSTAD, TROND, SKEIE, TOR
Application year: 2001
Main classification: H04L7
IPC codes: G04G7, H04J3, H04L1, H04L12, H04L29