180 likes | 406 Views
Embedded System Design for Network Time Synchronization So-Young Hwang, Dong-Hui Yu and Ki-Joune Li. So-Young Hwang Dept. of Computer Science Pusan National Univ. 2004. 08. 25. Contents. Introduction General computer clock model Needs for time synchronization
E N D
Embedded System Design for Network Time SynchronizationSo-Young Hwang, Dong-Hui Yu and Ki-Joune Li So-Young Hwang Dept. of Computer Science Pusan National Univ. 2004. 08. 25
Contents • Introduction • General computer clock model • Needs for time synchronization • Approaches for time synchronization • Embedded System for Network Time Synchronization • Functional architecture • A clock model • Prototype implementation • Experiments • Plan and environment • Experiment results • Concluding Remarks EUC 2004
General Computer Clock Model • Computer clock • Keep track of current time • Various accounting purposes • CPU utilization • Disk I/O, and so on • Consists of 3 component • Quartz crystal • Counter register • Constant register • Limits in accuracy and precision • Inherent instability • Environment elements • Modifications of users, and errors of the system EUC 2004
Needs for Time Synchronization • Critical piece of infrastructure for any distributed system • Log file accuracy, auditing and monitoring • Network fault diagnosis and recovery • File time stamps • Directory services • Access security and authentication • Distributed computing • Scheduled operations • Real-world time values / Interaction with users • Purpose of synchronizing clocks • Provide a global time base throughout a distributed system EUC 2004
Approaches for Time Synchronization • Replaces a local clock with a higher cost, accurate and precise clock • Found in mobile communication system • PTS among the IS-95 CDMA base stations • Request services from the external clocks that keep standard time • Based on server-client model • NTP on the Internet EUC 2004
Design issues Acquire standard time Maintain accurate and precise local clock Distribute time information GPS Adapted as a reference clock source Time keeper Specified in clock model NTP Applied for time distribution Functional architecture Embedded System for Network Time Synchronization EUC 2004
GPS Satellites GPS Referenced Stratum 1 Server SNMP CONTROL GPS Referenced Stratum 1 Server GPS Referenced Stratum 1 Server GPS Referenced Stratum 1 Server NTP TIME SERVICE NTP TIME SERVICE NTP TIME SERVICE W/S W/S W/S W/S W/S W/S W/S W/S W/S W/S W/S W/S GPS Referenced Time Distribution Model EUC 2004
Proposed Clock Model for Synchronization • Time keeping mechanism • System clock initialized by GPS • Periodic signal of one second time interval is adapted as interrupt to synchronize the local clock EUC 2004
Hardware 32bit RISC ARM7TDMI 100BaseT Ethernet GPS engine 10MHz VCTCXO Software OS: pSOSystem BSP TCP/IP protocol NTP, SNMP Prototype Implementation (1/2) EUC 2004
GPS engine Connected through RS-232C Sends position, status and date/time message every one second GPS message format Clock model implementation System clock and NTP clock are initialized synchronizing to the GPS reference clock 1PPS reference time interval Analyze error of local clock Prototype Implementation (2/2) EUC 2004
ti-3 ti-2 client server ti-1 ti Experiments • Evaluation factor • Frequency of the local clock to evaluate accuracy and stability • Use standard NTP query program to evaluate time distribution • NTP is designed to produce 3 products • Clock offset: amount to adjust the local clock • Round-trip delay • Dispersion: maximum error of the local clock Timestamps exchange are used to determine 3 products EUC 2004
Evaluation Environment Time distribution Accuracy & stability • HP53132A: Universal counter • HP59551A: GPS synchronization module • Linux W/S as NTP client • Monitoring & data logging PC • IEEE 488 GPIB, RS-232C interface EUC 2004
Fig. Relationship between accuracy and stability Evaluation (1/2) • Frequency measurement result • Traces the nominal frequency in about 0.5Hz error boundary • Nominal frequency: ideal frequency EUC 2004
Variation of clock offset Variation of clock dispersion Evaluation (2/2) EUC 2004
Conclusion • Computer clock has limits in accuracy and precision • Inherent instability, environment elements, modifications of users, and errors of the system • Needs to be synchronized with a standard clock • Purpose of synchronizing clocks is to provide a global time base throughout a distributed system • Design issues and implementation of an embedded system for network time synchronization • Uses GPS as a standard reference time source • Clock model to maintain accurate and precise time • Offers UTC through the NTP EUC 2004
Future Work • Clock model and clock discipline mechanism to maintain more accurate and stable time • Wireless sensor networks • Make extensive use of synchronized time • Have unique requirements in the scope, lifetime, and precision of the synchronization achieved, as well as the time and energy required to achieve it • Existing time synchronization methods need to be extended / modified to meet these new needs EUC 2004
Peer 1 Filter 1 Intersection and Clustering Algorithms Combining Algorithm Peer 2 Filter 2 Loop Filter P/F-Lock Loop Peer 3 Filter 3 LCO NTP Messages Timestamps How NTP works • Multiple servers/peers provide redundancy and diversity • Clock filters select best from a window of eight clock offset samples • Intersection and clustering algorithms pick best subset of peers and discard outliers • Combining algorithm computes weighted average of offsets for best accuracy • Loop filter and LCO implement hybrid phase/frequency-lock (P/F) feedback loop to minimize jitter and wander
NTP Protocol Header Format (32 bits) LI leap warning indicator VN version number (4) Strat stratum (0-15) Poll poll interval (log2) Prec precision (log2) LI VN Mode Strat Poll Prec Root Delay Root Dispersion Reference Identifier Reference Timestamp (64) NTP Timestamp Format (64 bits) Originate Timestamp (64) Seconds (32) Fraction (32) Value is in seconds and fraction since 0h 1 January 1900 Cryptosum Receive Timestamp (64) Transmit Timestamp (64) NTP v4 Extension Field Extension Field 1 (optional) Field Length Field Type Extension Field (padded to 32-bit boundary) Extension Field 2… (optional) Last field padded to 64-bit boundary Key/Algorithm Identifier NTP v3 and v4 Authenticator (Optional) Message Hash (64 or 128) NTP v4 only authentication only NTP Protocol Header and Timestamp Formats EUC 2004