SlideShare a Scribd company logo
1 of 34
#apricot2019 2019 47
What’s the Time?
Geoff Huston
APNIC
#apricot2019 2019 47
Background
• All computers run with some kind of internal oscillator
(called a ‘clock’)
– This clock manages the internal state changes at each cycle of the
central processing unit
– Clock ‘ticks’ are fed to a digital counter
– From this counter the computer can maintain a conventional clock
and maintain the current time
#apricot2019 2019 47
Why is Time useful for a computer?
• To understand when things happen
– Crontab and event scheduling to ensure that a computer performs
certain tasks at precise times
• To understand the relative age of things
– For example, with NFS file systems its vital to understand which file is
more recent
• To understand when things are valid
#apricot2019 2019 47
Security Certificates and Time
These security credentials are
only usable in a defined
window of time
The computer’s local clock is
compared to these dates to
determine whether to trust
this certificate or not
#apricot2019 2019 47
So we need to keep “time”
• But this can be challenging
• Computer clocks are based on quartz crystal oscillation
– Quartz crystal oscillation is only stable if the temperature and excitation
voltage are kept stable. Changes in temperature or voltage will cause
oscillation changes
• Computer time of day clocks rely on counting ticks in a register
– Which is performed by software running in the processor at an elevated
interrupt level
– If the processor runs for extended times at an even higher interrupt level
then clock ticks can be ‘lost’
#apricot2019 2019 47
Example of Computer Clock
Stability
Dave Mill’s 2001 experiment on
looking at clock stability over a one
week period using a Linux PC
https://www.eecis.udel.edu/~ntp/ntpfaq
/NTP-s-sw-clocks.htm
#apricot2019 2019 47
So we need to keep “time”
• We actually want to keep accurate and stable time
– Accurate in that every reference timekeeper keeps the same time
(modulo the spacetime stretch factors of relativity)
– Stable in that the duration of each measured interval is exactly the
same
#apricot2019 2019 47
So we need to keep “time”
What is “time”?
• We all know that time is divided into days, where a ‘day’ is
defined as the duration between successive events when
the sun is at precisely the same elevation in the sky
– But we don’t do this any more because the earth and the sun are
poor timekeepers
• We turned to distant quasars as the reference point
– But we don’t do this any more because we needed even greater
precision
#apricot2019 2019 47
So we need to keep “time”
• We turned to nuclear physics:
– Time is defined using Système International (SI) seconds, defined as
the duration of 9,192,631,770 periods of the radiation emitted by a
caesium-133 atom in the transition between the two hyperfine levels
of its ground state at a temperature of 0K
#apricot2019 2019 47
Keeping Accurate Time
• Not everyone can afford to run their own caesium clock
#apricot2019 2019 47
Keeping Accurate Time
Not everyone can launch their own GPS network
• The GPS satellite constellation is a set of 31
active earth-orbiting spacecraft operated by
the US Air Force
• These spacecraft are equipped with Caesium-
133 reference clocks that broadcast time
signals
• GPS receivers can use triangulation from
multiple satellites and delay measurement to
determine the receiver’s position and provide
an accurate reference time
#apricot2019 2019 47
Distributing Accurate Time
• Not every computer runs their own Cesium Clock or runs a
GPS receiver to maintain accurate time
– But some folk do, and that’s a good thing!
• So what we would like is a way to take this set of highly
accurate reference time sources and provide a mechanism
for others to synchronize their local clock against a
reference source
• On the Internet we use the Network Time Protocol (NTP) to
perform this time synchronization function
#apricot2019 2019 47
NTP Operation
• Time sources are classified by their accuracy
– A Stratum 0 server is a reference clock (GPS or cesium)
– A Stratum 1 server is directly connected to a reference clock source
– A Stratum 2 server receives its time from a Stratum 1 server, and so on
• NTP is a simple clock exchange UDP protocol
1 – client time
1 – client time
2 – server time
T1
T3T4
1 – client time
1 – client time
2 – server time
Client Offset = ½ ((T2-T1) + (T3-T4))
T2
Client Server
#apricot2019 2019 47
NTP UDP Packets
A 48 byte UDP packet is passed between the client and server
The fields in the packet are:
• The header section contains leap seconds, NTP version, NTP
mode, Stratum level, polling interval and clock precision
• Server’s round trip delay to its reference source and dispersion
• Identification of reference source
• 64 bit reference date (seconds and fractions from 1 January 1900
00:00:00 UTC)
• Time the request left the client
• Time the request arrived at the server
• Time the response left the server
NTP runs UTC – remember this!
#apricot2019 2019 47
NTP Operation
• In steady state the UDP clock packet exchange happens every 16
seconds
– Faster clock exchanges happen when the client clock has lost
synchronisation with the server, and it will burst 8 packets evenly spaced
across a 16 second interval
• If the local clock needs to be adjusted the client time application will
use adjtime() to slew the local clock. Clock correction is slow –
0.5ms per second
– Jumping the clock can fatally confuse applications, so this gentle slew is far
kinder
• NTP can normally maintain a client clock within a few hundredths of
second of the server reference clock
#apricot2019 2019 47
So we all agree on the time?
• If everything supports NTP, and there is a well structured
mesh of NTP reference clock servers then every connected
Internet device that runs a clock should have the same
value of time
– “same” is within a tenth of a second or less
• But does the Internet agree on the time?
#apricot2019 2019 47
The Experiment
• Use a scripted online ad to direct a client to report back the value of the
client’s clock
– Use the Javascript getTime() method to get the local UTC clock value
– Pass this value to the server as an argument to a URL fetch operation
• Use NTP-managed clock on the server to maintain a stable reference
clock
• Record the distribution of differences
– Ignore the fine-grained differences due to local processing and network
propagation time
– Which means that we are looking at measurements of time within +/- 1 second as
being equivalent
#apricot2019 2019 47
Results
#apricot2019 2019 47
Log Scales can be misleading
19
#apricot2019 2019 47
Results
We tested the clock of 202,460,921 clients
over a 80 day period:
– 11% of clocks are more than 1 second fast
– 57% of clients are more than 1 second
slow
– We observed clock slew values of up to 1
year both fast and slow
– 92% of clients are within 120 seconds of
the reference clock
#apricot2019 2019 47
Fast Clocks
0.05% of all clocks are ahead
by more than 2 days
There is a clear step function in
this distribution that is aligned
quite precisely to whole days
How can a client clock maintain
a stable per-second clock, yet
report a time value that is off by
a number of whole days?
#apricot2019 2019 47
Fast Clocks
0.7% of all clocks are ahead by
more than 1 hour
As with the day distribution,
there is a marked clustering of
the clock offsets into units of
hours, and a slightly smaller
clustering into half-hours
Similar question: How can a
client clock maintain a stable
per-second clock, yet report a
time value that is off by a
number of whole hours?
#apricot2019 2019 47
Slow Clocks
0.15% of all clocks lag by more
than 2 days (3 x the number of
fast clocks)
The per-day clustering is not so
clear for slow clocks with a lag
of greater than 2 days.
#apricot2019 2019 47
Slow Clocks
1.05% of all clocks lag by 1
hour or more
Here there is a marked
clustering of the clock offsets
into units of hours
#apricot2019 2019 47
Clustering of Clock Slew Values
This is a distribution of the clock slew
values when the whole hours are removed
There is a very strong signal that when a
clock has slewed from UTC time it does so
in units of hours (and less so in units of half-
hours)
NTP does not stabilize a local clock into a
slew value of a whole number of hours, so
this distribution is not an artefact of NTP.
What is going on here?
#apricot2019 2019 47
Clustering of Clock Slew Values
This is a distribution of the clock slew
values when the whole hours are removed
There is a very strong signal that when a
clock has slewed from UTC time it does so
in units of hours (and less so in units of half-
hours)
NTP does not stabilize a local clock into a
slew value of a whole number of hours, so
this distribution is not an artefact of NTP.
What is going on here?
Does anyone here have some idea of what causes this?
#apricot2019 2019 47
A Possible Theory
Localtime and UTC time are getting confused
We can test this theory with some additional data
Lets look at 3 countries with a large user population
#apricot2019 2019 47
Brazil
• LocalTime is UTC – 2,
UTC-3, UTC -4, UTC-5
• DST is variously
applied in Brazil
• So we should expect
localtime at UTC -1
through UTC-5
#apricot2019 2019 47
India
• LocalTime is UTC +5:30
• DST is not applied in
India
• So we should expect
localtime at UTC +5:30
• This is not clearly evident
in the data
• There is a strong bias to
30 minute offsets, but no
pronounced peak at
+5:30
#apricot2019 2019 47
China
• LocalTime is UTC
+8
• DST is not applied in
China
• So we should
expect a peak of
localtime at UTC +8
#apricot2019 2019 47
A Possible Theory
Localtime and UTC time are getting confused
For the remainder of cases this is not simple clock drift. Some
time source is syncing the local hosts UTC clock to the right
second, but the hour value of the sync source is incorrect
This occurs between 10% to 20% of the time
#apricot2019 2019 47
A view of Whole of Internet Time
• Only 58% of visible clients run their clock with 2 seconds of
UTC time
• 92% of visible clients run a clock that is within 60 seconds
of UTC time
• 98% of clients are within 1 hour of UTC time
#apricot2019 2019 47
If your application’s behavior relies
on a consistent view of UTC time …
• Its probably a poor idea to assume that all local clocks are
tracking UTC time to within 1 hour
• Its probably more robust to work in periods of days rather
than seconds, minutes or even hours
#apricot2019 2019 47
Thanks!

More Related Content

What's hot

O'Reilly Webinar: Simplicity Scales - Big Data
O'Reilly Webinar: Simplicity Scales - Big Data O'Reilly Webinar: Simplicity Scales - Big Data
O'Reilly Webinar: Simplicity Scales - Big Data
Basho Technologies
 
Distributed monitoring
Distributed monitoringDistributed monitoring
Distributed monitoring
Leon Torres
 

What's hot (7)

(DVO204) Monitoring Strategies: Finding Signal in the Noise
(DVO204) Monitoring Strategies: Finding Signal in the Noise(DVO204) Monitoring Strategies: Finding Signal in the Noise
(DVO204) Monitoring Strategies: Finding Signal in the Noise
 
O'Reilly Webinar: Simplicity Scales - Big Data
O'Reilly Webinar: Simplicity Scales - Big Data O'Reilly Webinar: Simplicity Scales - Big Data
O'Reilly Webinar: Simplicity Scales - Big Data
 
Keystone - ApacheCon 2016
Keystone - ApacheCon 2016Keystone - ApacheCon 2016
Keystone - ApacheCon 2016
 
Distributed monitoring
Distributed monitoringDistributed monitoring
Distributed monitoring
 
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
(DVO205) Monitoring Evolution: Flying Blind to Flying by Instrument
 
Keystone - Leverage Big Data 2016
Keystone - Leverage Big Data 2016Keystone - Leverage Big Data 2016
Keystone - Leverage Big Data 2016
 
Building Stream Processing as a Service
Building Stream Processing as a ServiceBuilding Stream Processing as a Service
Building Stream Processing as a Service
 

Similar to Whats the Time

Similar to Whats the Time (20)

Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcu
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
 
Synchronisation
SynchronisationSynchronisation
Synchronisation
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
 
Clock synchronization in distributed system
Clock synchronization in distributed systemClock synchronization in distributed system
Clock synchronization in distributed system
 
Time synchronization solution: NTP
Time synchronization solution: NTPTime synchronization solution: NTP
Time synchronization solution: NTP
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
 
WSN ppt (1).pptx
WSN ppt (1).pptxWSN ppt (1).pptx
WSN ppt (1).pptx
 
Beyond January 3rd: Operationalization of Timekeeping
Beyond January 3rd: Operationalization of TimekeepingBeyond January 3rd: Operationalization of Timekeeping
Beyond January 3rd: Operationalization of Timekeeping
 
Clock synchronization
Clock synchronizationClock synchronization
Clock synchronization
 
Methods for Improving NTP
Methods for Improving NTPMethods for Improving NTP
Methods for Improving NTP
 
Real-Time Systems Intro.pptx
Real-Time Systems Intro.pptxReal-Time Systems Intro.pptx
Real-Time Systems Intro.pptx
 
L12.FA20.ppt
L12.FA20.pptL12.FA20.ppt
L12.FA20.ppt
 
Improving NTP Installed Base Time Accuracy
Improving NTP Installed Base Time AccuracyImproving NTP Installed Base Time Accuracy
Improving NTP Installed Base Time Accuracy
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
 
The Time Is Now The Convergence Of Networks, Time Synchronization And Inform...
The Time Is Now  The Convergence Of Networks, Time Synchronization And Inform...The Time Is Now  The Convergence Of Networks, Time Synchronization And Inform...
The Time Is Now The Convergence Of Networks, Time Synchronization And Inform...
 
Redis For Distributed & Fault Tolerant Data Plumbing Infrastructure
Redis For Distributed & Fault Tolerant Data Plumbing Infrastructure Redis For Distributed & Fault Tolerant Data Plumbing Infrastructure
Redis For Distributed & Fault Tolerant Data Plumbing Infrastructure
 
Shoaib
ShoaibShoaib
Shoaib
 

More from APNIC

More from APNIC (20)

Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
Registry Data Accuracy Improvements, presented by Chimi Dorji at SANOG 41 / I...
 
APNIC Updates presented by Paul Wilson at CaribNOG 27
APNIC Updates presented by Paul Wilson at  CaribNOG 27APNIC Updates presented by Paul Wilson at  CaribNOG 27
APNIC Updates presented by Paul Wilson at CaribNOG 27
 
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
APNIC Policy Roundup presented by Sunny Chendi at TWNOG 5.0
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
DDoS In Oceania and the Pacific, presented by Dave Phelan at NZNOG 2024
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Networking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOGNetworking in the Penumbra presented by Geoff Huston at NZNOG
Networking in the Penumbra presented by Geoff Huston at NZNOG
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
draft-harrison-sidrops-manifest-number-01, presented at IETF 119
draft-harrison-sidrops-manifest-number-01, presented at IETF 119draft-harrison-sidrops-manifest-number-01, presented at IETF 119
draft-harrison-sidrops-manifest-number-01, presented at IETF 119
 
Making an RFC in Today's IETF, presented by Geoff Huston at IETF 119
Making an RFC in Today's IETF, presented by Geoff Huston at IETF 119Making an RFC in Today's IETF, presented by Geoff Huston at IETF 119
Making an RFC in Today's IETF, presented by Geoff Huston at IETF 119
 
IPv6 Operational Issues (with DNS), presented by Geoff Huston at IETF 119
IPv6 Operational Issues (with DNS), presented by Geoff Huston at IETF 119IPv6 Operational Issues (with DNS), presented by Geoff Huston at IETF 119
IPv6 Operational Issues (with DNS), presented by Geoff Huston at IETF 119
 
Is DNS ready for IPv6, presented by Geoff Huston at IETF 119
Is DNS ready for IPv6, presented by Geoff Huston at IETF 119Is DNS ready for IPv6, presented by Geoff Huston at IETF 119
Is DNS ready for IPv6, presented by Geoff Huston at IETF 119
 
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
Benefits of doing Internet peering and running an Internet Exchange (IX) pres...
 
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
APNIC Update and RIR Policies for ccTLDs, presented at APTLD 85
 
NANOG 90: 'BGP in 2023' presented by Geoff Huston
NANOG 90: 'BGP in 2023' presented by Geoff HustonNANOG 90: 'BGP in 2023' presented by Geoff Huston
NANOG 90: 'BGP in 2023' presented by Geoff Huston
 
DNS-OARC 42: Is the DNS ready for IPv6? presentation by Geoff Huston
DNS-OARC 42: Is the DNS ready for IPv6? presentation by Geoff HustonDNS-OARC 42: Is the DNS ready for IPv6? presentation by Geoff Huston
DNS-OARC 42: Is the DNS ready for IPv6? presentation by Geoff Huston
 
APAN 57: APNIC Report at APAN 57, Bangkok, Thailand
APAN 57: APNIC Report at APAN 57, Bangkok, ThailandAPAN 57: APNIC Report at APAN 57, Bangkok, Thailand
APAN 57: APNIC Report at APAN 57, Bangkok, Thailand
 
Lao Digital Week 2024: It's time to deploy IPv6
Lao Digital Week 2024: It's time to deploy IPv6Lao Digital Week 2024: It's time to deploy IPv6
Lao Digital Week 2024: It's time to deploy IPv6
 

Recently uploaded

一比一原版英国格林多大学毕业证如何办理
一比一原版英国格林多大学毕业证如何办理一比一原版英国格林多大学毕业证如何办理
一比一原版英国格林多大学毕业证如何办理
AS
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
pxcywzqs
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
apekaom
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
AS
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
F
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
ayvbos
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
AS
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
mikehavy0
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
F
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
ayvbos
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样
AS
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
A
 
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
AS
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
c6eb683559b3
 

Recently uploaded (20)

一比一原版英国格林多大学毕业证如何办理
一比一原版英国格林多大学毕业证如何办理一比一原版英国格林多大学毕业证如何办理
一比一原版英国格林多大学毕业证如何办理
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
一比一原版桑佛德大学毕业证成绩单申请学校Offer快速办理
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
一比一原版(Dundee毕业证书)英国爱丁堡龙比亚大学毕业证如何办理
 
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptxA LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
A LOOK INTO NETWORK TECHNOLOGIES MAINLY WAN.pptx
 
一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理一比一原版帝国理工学院毕业证如何办理
一比一原版帝国理工学院毕业证如何办理
 
Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.Meaning of On page SEO & its process in detail.
Meaning of On page SEO & its process in detail.
 
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
一比一原版(Curtin毕业证书)科廷大学毕业证原件一模一样
 
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
一比一原版(Polytechnic毕业证书)新加坡理工学院毕业证原件一模一样
 
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptxResearch Assignment - NIST SP800 [172 A] - Presentation.pptx
Research Assignment - NIST SP800 [172 A] - Presentation.pptx
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
Abortion Clinic in Germiston +27791653574 WhatsApp Abortion Clinic Services i...
 
一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理一比一原版田纳西大学毕业证如何办理
一比一原版田纳西大学毕业证如何办理
 
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
一比一原版(Flinders毕业证书)弗林德斯大学毕业证原件一模一样
 
原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样原版定制英国赫瑞瓦特大学毕业证原件一模一样
原版定制英国赫瑞瓦特大学毕业证原件一模一样
 
一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理一比一原版美国北卡罗莱纳大学毕业证如何办理
一比一原版美国北卡罗莱纳大学毕业证如何办理
 
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303Lowongan Kerja LC Yogyakarta Terbaru 085746015303
Lowongan Kerja LC Yogyakarta Terbaru 085746015303
 
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
一比一原版(毕业证书)新加坡南洋理工学院毕业证原件一模一样
 
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
一比一原版(NYU毕业证书)美国纽约大学毕业证学位证书
 

Whats the Time

  • 1. #apricot2019 2019 47 What’s the Time? Geoff Huston APNIC
  • 2. #apricot2019 2019 47 Background • All computers run with some kind of internal oscillator (called a ‘clock’) – This clock manages the internal state changes at each cycle of the central processing unit – Clock ‘ticks’ are fed to a digital counter – From this counter the computer can maintain a conventional clock and maintain the current time
  • 3. #apricot2019 2019 47 Why is Time useful for a computer? • To understand when things happen – Crontab and event scheduling to ensure that a computer performs certain tasks at precise times • To understand the relative age of things – For example, with NFS file systems its vital to understand which file is more recent • To understand when things are valid
  • 4. #apricot2019 2019 47 Security Certificates and Time These security credentials are only usable in a defined window of time The computer’s local clock is compared to these dates to determine whether to trust this certificate or not
  • 5. #apricot2019 2019 47 So we need to keep “time” • But this can be challenging • Computer clocks are based on quartz crystal oscillation – Quartz crystal oscillation is only stable if the temperature and excitation voltage are kept stable. Changes in temperature or voltage will cause oscillation changes • Computer time of day clocks rely on counting ticks in a register – Which is performed by software running in the processor at an elevated interrupt level – If the processor runs for extended times at an even higher interrupt level then clock ticks can be ‘lost’
  • 6. #apricot2019 2019 47 Example of Computer Clock Stability Dave Mill’s 2001 experiment on looking at clock stability over a one week period using a Linux PC https://www.eecis.udel.edu/~ntp/ntpfaq /NTP-s-sw-clocks.htm
  • 7. #apricot2019 2019 47 So we need to keep “time” • We actually want to keep accurate and stable time – Accurate in that every reference timekeeper keeps the same time (modulo the spacetime stretch factors of relativity) – Stable in that the duration of each measured interval is exactly the same
  • 8. #apricot2019 2019 47 So we need to keep “time” What is “time”? • We all know that time is divided into days, where a ‘day’ is defined as the duration between successive events when the sun is at precisely the same elevation in the sky – But we don’t do this any more because the earth and the sun are poor timekeepers • We turned to distant quasars as the reference point – But we don’t do this any more because we needed even greater precision
  • 9. #apricot2019 2019 47 So we need to keep “time” • We turned to nuclear physics: – Time is defined using Système International (SI) seconds, defined as the duration of 9,192,631,770 periods of the radiation emitted by a caesium-133 atom in the transition between the two hyperfine levels of its ground state at a temperature of 0K
  • 10. #apricot2019 2019 47 Keeping Accurate Time • Not everyone can afford to run their own caesium clock
  • 11. #apricot2019 2019 47 Keeping Accurate Time Not everyone can launch their own GPS network • The GPS satellite constellation is a set of 31 active earth-orbiting spacecraft operated by the US Air Force • These spacecraft are equipped with Caesium- 133 reference clocks that broadcast time signals • GPS receivers can use triangulation from multiple satellites and delay measurement to determine the receiver’s position and provide an accurate reference time
  • 12. #apricot2019 2019 47 Distributing Accurate Time • Not every computer runs their own Cesium Clock or runs a GPS receiver to maintain accurate time – But some folk do, and that’s a good thing! • So what we would like is a way to take this set of highly accurate reference time sources and provide a mechanism for others to synchronize their local clock against a reference source • On the Internet we use the Network Time Protocol (NTP) to perform this time synchronization function
  • 13. #apricot2019 2019 47 NTP Operation • Time sources are classified by their accuracy – A Stratum 0 server is a reference clock (GPS or cesium) – A Stratum 1 server is directly connected to a reference clock source – A Stratum 2 server receives its time from a Stratum 1 server, and so on • NTP is a simple clock exchange UDP protocol 1 – client time 1 – client time 2 – server time T1 T3T4 1 – client time 1 – client time 2 – server time Client Offset = ½ ((T2-T1) + (T3-T4)) T2 Client Server
  • 14. #apricot2019 2019 47 NTP UDP Packets A 48 byte UDP packet is passed between the client and server The fields in the packet are: • The header section contains leap seconds, NTP version, NTP mode, Stratum level, polling interval and clock precision • Server’s round trip delay to its reference source and dispersion • Identification of reference source • 64 bit reference date (seconds and fractions from 1 January 1900 00:00:00 UTC) • Time the request left the client • Time the request arrived at the server • Time the response left the server NTP runs UTC – remember this!
  • 15. #apricot2019 2019 47 NTP Operation • In steady state the UDP clock packet exchange happens every 16 seconds – Faster clock exchanges happen when the client clock has lost synchronisation with the server, and it will burst 8 packets evenly spaced across a 16 second interval • If the local clock needs to be adjusted the client time application will use adjtime() to slew the local clock. Clock correction is slow – 0.5ms per second – Jumping the clock can fatally confuse applications, so this gentle slew is far kinder • NTP can normally maintain a client clock within a few hundredths of second of the server reference clock
  • 16. #apricot2019 2019 47 So we all agree on the time? • If everything supports NTP, and there is a well structured mesh of NTP reference clock servers then every connected Internet device that runs a clock should have the same value of time – “same” is within a tenth of a second or less • But does the Internet agree on the time?
  • 17. #apricot2019 2019 47 The Experiment • Use a scripted online ad to direct a client to report back the value of the client’s clock – Use the Javascript getTime() method to get the local UTC clock value – Pass this value to the server as an argument to a URL fetch operation • Use NTP-managed clock on the server to maintain a stable reference clock • Record the distribution of differences – Ignore the fine-grained differences due to local processing and network propagation time – Which means that we are looking at measurements of time within +/- 1 second as being equivalent
  • 19. #apricot2019 2019 47 Log Scales can be misleading 19
  • 20. #apricot2019 2019 47 Results We tested the clock of 202,460,921 clients over a 80 day period: – 11% of clocks are more than 1 second fast – 57% of clients are more than 1 second slow – We observed clock slew values of up to 1 year both fast and slow – 92% of clients are within 120 seconds of the reference clock
  • 21. #apricot2019 2019 47 Fast Clocks 0.05% of all clocks are ahead by more than 2 days There is a clear step function in this distribution that is aligned quite precisely to whole days How can a client clock maintain a stable per-second clock, yet report a time value that is off by a number of whole days?
  • 22. #apricot2019 2019 47 Fast Clocks 0.7% of all clocks are ahead by more than 1 hour As with the day distribution, there is a marked clustering of the clock offsets into units of hours, and a slightly smaller clustering into half-hours Similar question: How can a client clock maintain a stable per-second clock, yet report a time value that is off by a number of whole hours?
  • 23. #apricot2019 2019 47 Slow Clocks 0.15% of all clocks lag by more than 2 days (3 x the number of fast clocks) The per-day clustering is not so clear for slow clocks with a lag of greater than 2 days.
  • 24. #apricot2019 2019 47 Slow Clocks 1.05% of all clocks lag by 1 hour or more Here there is a marked clustering of the clock offsets into units of hours
  • 25. #apricot2019 2019 47 Clustering of Clock Slew Values This is a distribution of the clock slew values when the whole hours are removed There is a very strong signal that when a clock has slewed from UTC time it does so in units of hours (and less so in units of half- hours) NTP does not stabilize a local clock into a slew value of a whole number of hours, so this distribution is not an artefact of NTP. What is going on here?
  • 26. #apricot2019 2019 47 Clustering of Clock Slew Values This is a distribution of the clock slew values when the whole hours are removed There is a very strong signal that when a clock has slewed from UTC time it does so in units of hours (and less so in units of half- hours) NTP does not stabilize a local clock into a slew value of a whole number of hours, so this distribution is not an artefact of NTP. What is going on here? Does anyone here have some idea of what causes this?
  • 27. #apricot2019 2019 47 A Possible Theory Localtime and UTC time are getting confused We can test this theory with some additional data Lets look at 3 countries with a large user population
  • 28. #apricot2019 2019 47 Brazil • LocalTime is UTC – 2, UTC-3, UTC -4, UTC-5 • DST is variously applied in Brazil • So we should expect localtime at UTC -1 through UTC-5
  • 29. #apricot2019 2019 47 India • LocalTime is UTC +5:30 • DST is not applied in India • So we should expect localtime at UTC +5:30 • This is not clearly evident in the data • There is a strong bias to 30 minute offsets, but no pronounced peak at +5:30
  • 30. #apricot2019 2019 47 China • LocalTime is UTC +8 • DST is not applied in China • So we should expect a peak of localtime at UTC +8
  • 31. #apricot2019 2019 47 A Possible Theory Localtime and UTC time are getting confused For the remainder of cases this is not simple clock drift. Some time source is syncing the local hosts UTC clock to the right second, but the hour value of the sync source is incorrect This occurs between 10% to 20% of the time
  • 32. #apricot2019 2019 47 A view of Whole of Internet Time • Only 58% of visible clients run their clock with 2 seconds of UTC time • 92% of visible clients run a clock that is within 60 seconds of UTC time • 98% of clients are within 1 hour of UTC time
  • 33. #apricot2019 2019 47 If your application’s behavior relies on a consistent view of UTC time … • Its probably a poor idea to assume that all local clocks are tracking UTC time to within 1 hour • Its probably more robust to work in periods of days rather than seconds, minutes or even hours