Transcript Document

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
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
2004-08-25
EUC 2004
2
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
2004-08-25
EUC 2004
3
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
2004-08-25
EUC 2004
4
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
2004-08-25
EUC 2004
5
Embedded System for Network Time
Synchronization
Design issues
Functional architecture
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
2004-08-25
EUC 2004
6
GPS Referenced Time Distribution Model
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
2004-08-25
W/S
W/S
W/S
W/S
W/S
EUC 2004
W/S
W/S
W/S
W/S
W/S
W/S
7
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
2004-08-25
EUC 2004
8
Prototype Implementation (1/2)
Hardware
Software
32bit RISC ARM7TDMI
OS: pSOSystem
100BaseT Ethernet
BSP
GPS engine
TCP/IP protocol
10MHz VCTCXO
NTP, SNMP
2004-08-25
EUC 2004
9
Prototype Implementation (2/2)
GPS engine
Clock model implementation
Connected through RS-232C
Sends position, status and
date/time message every one
second
GPS message format
2004-08-25
System clock and NTP clock are
initialized synchronizing to the
GPS reference clock
1PPS reference time interval
Analyze error of local clock
EUC 2004
10
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
ti-3
ti-2
client
server
ti
2004-08-25
ti-1
EUC 2004
11
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
2004-08-25
EUC 2004
12
Evaluation (1/2)
Frequency measurement result
Traces the nominal frequency in about 0.5Hz error
boundary
Nominal frequency: ideal frequency
Fig. Relationship between
accuracy and stability
2004-08-25
EUC 2004
13
Evaluation (2/2)
Variation of clock offset
2004-08-25
Variation of clock dispersion
target system
public server 1
public server 2
system peer
64%
–
36%
candidate
36%
100%
64%
EUC 2004
14
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
2004-08-25
EUC 2004
15
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
2004-08-25
EUC 2004
16
How NTP works
Peer 1
Filter 1
Peer 2
Filter 2
Peer 3
Filter 3
NTP Messages
Intersection
and
Clustering
Algorithms
Combining
Algorithm
Loop Filter
P/F-Lock Loop
Timestamps
LCO
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
2015/7/16
17
NTP Protocol Header and Timestamp
Formats
NTP Protocol Header Format (32 bits)
LI VN Mode Strat Poll
Root Delay
Root Dispersion
Reference Identifier
Cryptosum
Prec
LI
VN
Strat
Poll
Prec
leap warning indicator
version number (4)
stratum (0-15)
poll interval (log2)
precision (log2)
Reference Timestamp (64)
NTP Timestamp Format (64 bits)
Originate Timestamp (64)
Receive Timestamp (64)
Seconds (32)
Fraction (32)
Value is in seconds and fraction
since 0h 1 January 1900
Transmit Timestamp (64)
NTP v4 Extension Field
Field Length
Extension Field 1 (optional)
Extension Field 2… (optional)
Key/Algorithm Identifier
Authenticator
(Optional)
2004-08-25
Message Hash (64 or 128)
EUC 2004
Field Type
Extension Field
(padded to 32-bit boundary)
Last field padded to 64-bit boundary
NTP v3 and v4
NTP v4 only
authentication only
18