clock sync 1
TRANSCRIPT
-
7/24/2019 Clock Sync 1
1/45
Wireless Sensor Networks
Clock Synchronization
Professor Jack Stankovic
University of Virginia
-
7/24/2019 Clock Sync 1
2/45
Why is clock sync important
Spatial-emporal System Where an! whenevents occ"r
o !isting"ish m"ltiple events# comp"telifetime of event# coor!inate sensing#coor!inate control actions $for wake-"p#for act"ators# %& # %
Signal processing $local clock may 'eeno"gh&
Comp"te velocity
-
7/24/2019 Clock Sync 1
3/45
Co"l! we have a WSN witho"t clocksync() *f all operations are logical
+r Use ,PS) Power h"ngry
) ./pensive per no!e
-
7/24/2019 Clock Sync 1
4/45
+"tline
NP $Network ime Protocol& ) for*nternet
01S $0eference 1roa!cast Sync&
PSN $ime-sync Protocol for SensorNetworks&
2SP $2loo!ing ime Sync Protocol&
-
7/24/2019 Clock Sync 1
5/45
What is Clock Sync
he clocks of each no!e in the WSNsho"l! rea! the same time withinepsilon an!remain that way
) Sync clocks
) 3an!le clock !rift $"p to 45 microsec per
secon! on 6ica platform7 89:8 63z clock& Sol"tion; 0e-sync $e/pensive&
Sol"tion; .stimate clock !rift an! compensate
-
7/24/2019 Clock Sync 1
6/45
3ow 'a! is 45 microsec>sec(
45 / ?5 @ A#455 microsec>min
A#455 / ?5 @ B44#555 microsec>hr
B44#555 / A4 @ :#4?#555 microsec>!ay
-
7/24/2019 Clock Sync 1
7/45
,oals for Clock Sync inWSN
6eet re="ire! precision
Dow comm"nication 1W
0o'"st against no!e an! link fail"res
6"lti-hop $large scale&
-
7/24/2019 Clock Sync 1
8/45
NP
Network ime Protocol $NP& on *nternet
) *ncl"!e! in +S co!e) Simple NP $SNP& e/ists for PCs
) 0"ns as 'ackgro"n! process) ,et time from E'estF servers
2in!s those with lowest Gitter>latency
-
7/24/2019 Clock Sync 1
9/45
NP
Not $!irectly& "sa'le for WSN) Comple/ ) see 5 page !oc"ment
) Contin"o"s cost
) Darge co!e size
) ./pensive in messages>energy
) Non-!eterminism at 6HC layer $per hop&
if NP was implemente! in WSN can a!! B55sms !elay
-
7/24/2019 Clock Sync 1
10/45
Clock Sync
-
7/24/2019 Clock Sync 1
11/45
Clock Sync -
-
7/24/2019 Clock Sync 1
12/45
Clock Sync -
-
7/24/2019 Clock Sync 1
13/45
*!eal
0ea!Clock 5 5
SetClock
Hll Iero Costs>
-
7/24/2019 Clock Sync 1
14/45
What if
-
7/24/2019 Clock Sync 1
15/45
01S
0eference messageis 'roa!cast 0eceivers recor! their local time when message is
receive!) imestamps are +ND on the receiver si!e
) his eliminates access an! sen! times No!es e/change their recor!e! times with each
other AK9B microsec acc"racy for B hop case
No transmitter si!e non-!eterminism
Not e/ten!e! to large m"lti-hop networks
-
7/24/2019 Clock Sync 1
16/45
01S
5
6
7
Docal ime
Sen! 6S,
No Clock
6,7
5,7
5,6
./change H!G"st
Plus 2
Plus 1
OK
Propagation ime @ 5
-
7/24/2019 Clock Sync 1
17/45
What can ca"se the Ei!ealF case of allthree no!es getting the clock messageat the EsameF time to 'e false(
) No!e t"rns off interr"pts Co!e e/plicitly t"rns off interr"pts
nesC atomic statement
) No!e t"rns off ra!io $sleep mo!e&
-
7/24/2019 Clock Sync 1
18/45
PSN
Creates a spanning tree
Perform pairwise sync along e!ges ofthe tree
6"st 'e symmetric links) 0ecall ra!io irreg"larity paper
Consi!ers EentireF system) 01S looks at one hop
./change two sync messages withparent no!e
-
7/24/2019 Clock Sync 1
19/45
Synchronization Phase
-
7/24/2019 Clock Sync 1
20/45
./ample
T1= 5.0
T2=5.35 T3=6.0
T4=5.75
Node A
Node B
P = ((T2-T1)+(T4-T3))/2
-
7/24/2019 Clock Sync 1
21/45
PSN
No 'roa!casting so PSN is e/pensive imestamp the message in the 6HC
layerm"ltiple times an! average those
times $improves acc"racy over 01S 'y Atimes&
$B?9K microsec acc"racy for B hop&
No clock !rift corrections
-
7/24/2019 Clock Sync 1
22/45
0ea! Clock in 6HC Dayer Uncertainties of ra!io message !elivery
-
7/24/2019 Clock Sync 1
23/45
PSN
Hss"mes topology !oes not change) Not ro'"st to fail"re of a no!e
No!e fails ) m"st re!o the spanning tree
-
7/24/2019 Clock Sync 1
24/45
2loo!ing ime SyncProtocol $2SP&
*mplemente! on 6ica platform
LB 6icrosec acc"racy
6HC-layer timestamp Skew compensation with linear
regression $acco"nts for !rift&
Perio!ic floo!ing ) ro'"st to fail"resan! topology changes
3an!les large scale networks
-
7/24/2019 Clock Sync 1
25/45
0emove Uncertainties
.liminate Sen! Uncertainty) ,et time in the 6HC layer
.liminate Hccess ime) ,et time after the message has access to
the channel
.liminate 0eceive ime
) 0ecor! local time message receive! at the6HC layer
-
7/24/2019 Clock Sync 1
26/45
0emaining
$6ostly&
-
7/24/2019 Clock Sync 1
27/45
1asic *!ea
When to time stamp the message
sender
receiver
6icaA "ncertainties;
*nterr"pt;"s# :5"s$MA&.nco!eO!eco!e;BB5"s -BBA"s
1yte align; 5"s ) :?"s
Propagation; B"s
,et timestamp
Set timestamp
0ea!y
-
7/24/2019 Clock Sync 1
28/45
1asic *!ea When to time stamp the message
) 0a!io layer# after the secon! SN sent o"t#? timestamps in row# take the average an!sen! only B timestamp
Normalize and then
take Average of these
timestamps for 6 bytes
of data
-
7/24/2019 Clock Sync 1
29/45
Why take ? samples(
1eca"se of all the "ncertainties as!escri'e! in a previo"s sli!e
-
7/24/2019 Clock Sync 1
30/45
2SP
0oot maintains glo'al time for system Hll others sync to the root No!es form an a! hoc str"ct"re rather
than a spanning tree 0oot 'roa!casts a timestamp for the
transmission time of a certain 'yte
.very receiver time stamps receptionof that 'yte Hcco"nt for !eterministic times
-
7/24/2019 Clock Sync 1
31/45
S"mmary of 2SPSo 2ar
$1elow& 6HC-layer timestamp
Correct sen!er timestamp to acco"ntfor known !elays) Comp"te final offset error
0es"lt; B94 microsec acc"racy for B hop
-
7/24/2019 Clock Sync 1
32/45
Clock
-
7/24/2019 Clock Sync 1
33/45
1asic *!ea
entry linear regression ta'le toestimate clock skew $each entry !erive! fromB clock sync protocol e/ec"tion&
./ample
B "s offsetA "s offset: 8 "s offset
4 4 "s offset 4 "s offset? "s offset8 8 "s offset "s offset
"s overSay a B5 sec
0esync perio!
Compensate 9 "s.ach sec
10 se#o$ds
1 se#
-
7/24/2019 Clock Sync 1
34/45
Performance Single hop# stop sync after :: min"tes
$where sync was r"n every :5 secs&
./ample; *f clock sync stops at time :: an! error of B5
6icrosec is +Q7 then 8 min"te re-sync cycle is +Q
-
7/24/2019 Clock Sync 1
35/45
6"lti-3op ime Sync
Create a fi/e! spanning tree for clocksync !issemination like in PSN $notro'"st&
Use more a! hoc techni="e) Hss"me every no!e has "ni="e *0eference Point
0oot>0eference Point
Step B
Step A sync msgsto performDinear regression
3ow to han!le
messages fromm"ltiple no!es
-
7/24/2019 Clock Sync 1
37/45
Sync 6essage 2ormat
imestamp ) glo'al time estimate oftransmitter when 'roa!cast
0oot*