Overview of Time Synchronization Issues in Sensor Networks
5.4 Basics of Time Synchronization
As the factors described in Section . influence the error budget of the synchronized clocks, the pur-pose of a time synchronization protocol is to minimize the effects of these factors. Before developing a solution to address these factors, some basics of time synchronization for sensor networks need
Richard Zurawski/Networked Embedded Systems K_C Finals Page -- #
5-4 Networked Embedded Systems
H(t)
121011121314
Hardware clock time
1 1 + ρ
1 − ρ
t, Real-time
Ideal time
3456789
1 2 3 4 5 6 7 8 910 11 12 13 14
FIGURE . Drifting of hardware clock time.
to be discussed. These basics are to provide the fundamentals for designing a time synchronization protocol.
If a better clock crystal is used, the drift rate ρ may be much smaller. Usually, the hardware clock time H(t) at real-time t is within an linear envelope of the real-time as illustrated in Figure ..
Since the clock drifts away from real-time, the time difference between two events measured with the same hardware clock may have a maximum error of ρ(b − a) [], where a and b are the time of occurrence of first and second events, respectively. For modern computers, the clock granularity may be negligible, but it may contribute a significant portion to the error budget if the clock of a sensor node is really coarse, running at kHz range instead of MHz. In certain applications, a sensor node may have a volume of cm[], so a fast oscillator may not be possible or suitable.
Regardless of the clock granularity, the hardware clock time H(t) is usually translated into a vir-tual clock time by adding an adjustment constant to it. Normally, it is the virvir-tual clock time that we read from a computer. Hence, a time synchronization protocol may adjust the virtual clock time and/or discipline the hardware clock to compensate for the time difference between the clocks of the nodes. Either approach has to deal with the factors influencing time synchronization as described in Section ..
When an application issues a request to obtain the time, the time is returned after a certain delay.
Thissoftware access delay may fluctuate according to the loading of the system. This type of fluc-tuation is nondeterministic and may lessen if real-time operation system and hardware architecture are used. For low-end sensor nodes, the software access time may be in the order of few hundred microseconds. For example, a Mica mote is running at MHz [] having clock granularity of .
µs. If the node is % loaded and it takes cycles to obtain the time, the software access time is around µs.
In addition to the software access time, the medium access time also contributes to the nonde-terministic delay that a message experiences. If carrier-sense multiple access is used, the back off window size as well as the traffic load affect the medium access time [,,]. Once the sensor node obtains the channel, the transmission and propagation times are pretty deterministic, and they can be estimated by the packet size, transmission rate, and speed of light.
In summary, the delays experienced when sending a message at real-time t and receiving an acknowledgment (ACK) at real-time tare shown in Figure .. The message from node A incurs
Richard Zurawski/Networked Embedded Systems K_C Finals Page -- #
Overview of Time Synchronization Issues in Sensor Networks 5-5
M = Medium access time S = Software access time
R = Reception time P = Propagation time Sending message at t1
Receiving message at t2
Receiving ACK at t4
S1 M1 T1
T3 M3 S3
S4 R4
P12
R2 S2
P34
Sending message at t3
Node A Node B
T = Transmission time FIGURE . Round-trip time.
the software access, medium access, transmission, and propagation times. Theses times are repre-sented by S, M, T, and P. Once the message is received by node B at t, it will incur extra delays through receiving and processing. After the message is processed, an ACK is sent to node A at t. Thetotal delay at node B is the summation of R, S, ( ± ρB)(t−t), S, M, and T. After node B sends the ACK, the ACK propagates through the wireless medium and arrives at node A. Afterwards, node A processes the ACK. The path delays for sending and receiving the ACK from node B to A are P, R, and S. The round-trip time in real-time t for sending a message and receiving an ACK is calculated by
t−t=S+M+T+P+R+S+ ( ± ρB)(t−t) +S+M+T+P+R+S (.) where S, M, T, P, and R are the software access, medium access, transmission, propagation, and reception times, respectively. In addition, ρBis the drift rate at node B. The difference (t−t)is to account for the waiting time before an ACK is sent to node A by node B.
If the round-trip time is measured using the hardware clock of node A, it has to be adjusted by the drift rate of node A ρA. If the granularity of the hardware clock is coarse, the error δ contributed by the granularity should be accounted for. As a result, the round-trip time measured with the hardware clock is bounded by an error associated with the clock drift and granularity as determined by
( − ρA)(t−t) ≤H(t) −H(t) < ( + ρA)(t−t) +δ (.) The bound for the round-trip time fluctuates with respect to time since the software and medium access fluctuate according to the load at the node and in the channel. Although the transmission, propagation, and reception times may be deterministic, they may contribute to the asymmetric delay that can cause time offset between nodes A and B.
In the following section, different types of time synchronization protocols are described. Each of them tries to minimize the effect of the nondeterministic and asymmetric delays. For sensor net-works, it is best to minimize the propagation delay variation. For example, the delays and jitters
Richard Zurawski/Networked Embedded Systems K_C Finals Page -- #
5-6 Networked Embedded Systems
TABLE . Three Types of Timing Techniques
Type Description
. Relies on fixed time servers The nodes are synchronized to time servers that to synchronize the network are readily available. These time servers are
expected to be robust and highly precise.
. Translates time throughout The time is translated hop-by-hop from the the network source to the sink. In essence, it is a time
translation service.
. Self-organizes to synchronize The protocol does not depend on specialized time the network servers. It automatically organizes and determines
the master nodes as the temporary time servers.
between two nodes may be different in the forward and return paths. In addition, the jitters may vary significantly due to frequent node failures, since the messages are relayed hop-by-hop between the two nodes. The synchronization protocols in the following section focus on synchronizing nodes hop-by-hop, so the propagation time and variation do not play too much effect on the error of the synchronized clocks. Although the sensor nodes are densely deployed and they can take advantage of the close distance, the medium and software access times may contribute the most in the nondeter-ministic of the path delay during a one hop synchronization. The way to provide time synchronization for sensor networks may be different for different applications. The current timing techniques that are available for different applications are described in the following section.