measuring 802.1as slave clock accuracy · • ieee 802.1as is a 1588 “profile” with fewer...
TRANSCRIPT
1
Measuring 802.1AS Slave Clock AccuracyAlon Regev
Introduction to IEEE 1588 and IEEE 802.1AS
• IEEE 1588 & IEEE 802.1AS standards define how to synchronize time accurately between nodes on a network
• IEEE 1588 standardized the use of physical layer timestamps to compute network delays and define synchronization events
• This achieves much higher timing accuracy than legacy protocols (such as NTP*) where timestamping is typically done in SW
• IEEE 802.1AS is a 1588 “profile” with fewer options, and extended physical layer options • Faster clock locking• Allows for easier / lower cost implementation• Every device in the path (endpoints and relays) must support 802.1AS
* NTP refers to the “Network Time Protocol” defined by IETF RFC 5905.
IEEE 802.1AS: How it works
• Best Master Clock Algorithm (BMCA) is used to select a Grand Master• Grand Master periodically sends the clock using sync messages• Each Relay corrects timing information based on the delay through the cable as well as the delay through the
relay itself• The Relay acts as a slave in the port in which it receives a clock and as a master on other ports
• Slave endpoints receive timing information and correct for the delay through the cable.
PicturecourtesyofMichaelJohasTeener,postedtoWikipedia.Seehttps://en.wikipedia.org/wiki/File:Clock-Master.pdf
Time Correction in a Bridge
• Bridge Delays are now relatively constant, since they are just cable delays, without queues or buffers– 1588 calls this a “transparent clock”, required in 802.1AS
• A “correction field” in the FollowUp is incremented by the upstream delay and the residence time (t3-t2)– The correction field plus the precise origin timestamp plus the upstream delay is the correct time
master clock 802.1AS bridge
Synch tx: t1
rx: t2
queue synch
every 100ms
Synch
"downstream" device
FollowUp (t1)
FollowUp (t1*)
tx: t3
d
know: upstream path delay (d),
bridge delay (t3-t2),
calculate: t1*= t1 + d + (t3-t2)
t3-t2
note:
t3 and t2 are bridge-local times,
they do not have to be synch'd
to the master since only their
difference is significant
SlidecontentcourtesyofMichaelJohasTeener,presentedatDeterministicEthernetTutorial.Seehttp://www.ieee802.org/802_tutorials/2012-11/8021-tutorial-final-v4.pdf
Path Delay Processing
• Done infrequently since delays are stableSlidecontentcourtesyofMichaelJohasTeener,presentedatDeterministicEthernetTutorial.Seehttp://www.ieee802.org/802_tutorials/2012-11/8021-tutorial-final-v4.pdf
Why measuring slave clock accuracy is important
• Whilethe802.1ASalgorithmworkswell,imperfectimplementationsand/orhardwareissuescancausetheslaveclocknottotrackthemasterclock
• Itisimportanttoverify&certifyimplementationstomakesuretheyarecorrect.• Avnuhasdetailedtestplanstovalidate802.1AS• Typically,PTPorgPTP implementationsthathavenotbeenvalidatedwillhaveconformanceissues
• Tovalidatetheclockaccuracyonaslavedevice,welookattheTimeError(TE),whichisthedifferencebetweenthetestreference(802.1ASmaster)andtheDUT(802.1ASslave).
• ThisneedstobesampledoveralongperiodoftimetofindouttheMAXTE.
Different methods for measuring the slave Clock accuracy
1. Compare1PulsePerSecond(1PPS)orsimilaroutputbetweenthemasterandslave
2. “Ingressmethod”whereaslaveclockreportsthetimeerroritisseeingeachtimeitreceivesasyncpath
3. “Egressmethod”wheretheslaveprovidesthePTPtimeofmessagesthatitsent,whichcanbecomparedtothetimethesemessagesarereceivedbythemaster
4. “ReverseSyncmethod”wheretheslavesendssyncmessagesbacktothemastertovalidatethetiming• ThisisessentiallyavariationontheEgressmethodwherethemessageusedisaSyncmessageandthereis
noneedforadditionalmessagingtoidentifythePTPtimewhenthemessagewassent.
Thedetails,pros,andconsofeachmethodaredetailedinthenextslides.
Itisrecommendedtoimplementtestmodescontainingatleastoneoftheabovemethodsineachslave• Implementingmultiplemethodsallowscross-validationofthemeasurementmethods
SeeAvnurecommendationsathttp://avnu.org/wp-content/uploads/2014/05/Avnu-Testability-802.1AS-Recovered-Clock-Quality-Measurement-1.0_Approved-for-Public-Release.pdf
Using 1PPS outputs to validate slave time synchronization
• BothmasterandslaveoutputapulsethatstartsoneachsecondboundaryofthePTPclock• Anoscilloscopeisusedtocomparethetimeofthetwooutputs
• eachmeasurementshowsaphasedifferenceintheclock• Usingmultiplemeasurements,maximumtimeerrorandjittercanbeascertained.
Advantagesof1PPSmethod:• Knownindustrystandardwhichalreadyexistsonmanydevices.• Onlyanoscilloscopeisneededtomakethistest.
Shortcomingsof1PPSmethod:• Implementationofthe1PPSitselfissometimesimperfect,causingafixedphaseoffsetorjitter.• Somedevicescan’teasilysupporthavinga1PPSoutput(i.e.deviceswithmechanicalconstraintsthatpreventthis).• Thedevicesundertesthavetoberelativelyclosetogether• Notpracticalforlarge-scaletesting(suchasvalidatingtimesynchronizationinanentiresportsarenaorfactory).
Ingress method
IngressmethodreliesonSlavetodeclareit’serroratthemomentofreceivingaSyncmessage(Example:“WhenyousentmethelastSyncmessage,myrecoveredclockwhenreceivingitwasX”)Twoflavorsdefinedin1588,onethatreportserror,andonethatreportsT1andT2– sameprinciple!
DUT(Slave) TESTER(Master)
T1SyncT2Sync1.SlavesavesT2in
recoveredclocktimeofreceivingSyncmessage
2.SlavereceivesandsavesT1andsyncs
3.SlavereportsT1andT2orthecomputedoffsetFromMaster
4.MastercomputesrecordstimeerrorfromslaveprovideddataoffsetFromMaster=T2-T1-knownpathdelay
T1SyncT2Sync1.SlavesavesT2in
recoveredclocktimeofreceivingSyncmessage
2.SlavereceivesandsavesT1andsyncs
3.SlavereportsT1andT2orthecomputedoffsetFromMaster
4.MastercomputesrecordstimeerrorfromslaveprovideddataoffsetFromMaster=T2-T1-knownpathdelay
Ingress method pros/consAdvantagesofIngressmethod:• Reportingcanbedonein-bandwith1588proposedTLVsattachedonsignalingmessageorsimplylocallylogged/storedtobe
accessedremotelythroughYANG(idealforlivedeployments)• DoesnotrequireanyextracapabilityontheSlaveexceptsendingTLVs*/storingthedata
ShortcomingsofIngressmethod:• SamplingoftimeerrorisdependentonthetimingofincomingSyncmessages
ItmightnotreflecttheactualmaximumtimeerrorbetweentwoincomingSyncmessages• TheSlavecanreportavaluethatisnottheactualone
Thiscouldbeduetoafixedphaseoffset,codingerror,orduetointentionallyreturningvaluesthatmakethedeviceseembetter(veryhardtodetect,exampleinbackupslides)
=>theIngressmethodisnotadequateforcertificationtesting
*ATLV(orTypeLengthValue)isamessageformatdefinedinIEEEStd.1588.
Egress method
Egressmethod- Slavereportsit’srecoveredtimeatmomentwhenaneventmessageissent(Example:“Slave:thelastPdelayReqIsentwasatglobalgPTPtimeXaspermyrecoveredclock”)
AdvantagesofEgressmethod:• Testerevaluatestheerror,itdoesnotrelyontheSlavetoreportit• Reportingcanbedonein-bandwith1588proposedTLVsattachedonsignalingmessage• TimeofreportingisdecoupledfromthereceivetimeoftheincomingSyncmessages
ShortcomingsofEgressmethod:• Complicatedtouseindeployednetworks– needssupportfromdirectlyconnectedMasterofDUT
DUT(Slave) TESTER(Master)
1.SlavesendsPdelayReqandsavesT1- timeofsending
3.SlavesendssignalingmessagesindicatingT1
4.Testerreceivessignalingmessages,andcomputesTE=T2-T1-PD
2.TesterreceivesPdelayReqatT2andsavesvalue
Problems in using Egress method for gPTPForgPTPcommonsenseisthatreportingwouldbebasedonthesentPdelayReqeventmessages.IfPdelayReqmessagesaretimedimmediatelyorclosetoreceivingaSyncmessage(whencorrectionoftheclockismade),theymightnotrevealtheactualtimeerrorthedeviceisexperiencing.
1. ConsideraSlaveclockdrifting400nsbetweeneach2Syncmessages(125msinterval)2. ANDnotproperlyimplementingsyntonization(algorithmorrateratiocalculus)3. Thetimeerrorfunctionlookssimilartoasaw(resetsto~0ateachSyncreceived)4. IfeventPdelayReqissentcloseafterSyncisreceivedmeasurederrorislowerthanone5. BecausePdelayReqintervalisamultipleoftheSyncinterval,thiswouldhappenateverytime
Notjusttheory,thiswasexperiencedwithrealdevicesinlabtesting!
0
50
100
150
200
250
300
350
400
450
00.025
0.05
0.075
0.1
0.125
0.15
0.175
0.2
0.225
0.25
0.275
0.3
0.325
0.35
0.375
0.4
0.425
0.45
0.475
0.5
0.525
0.55
0.575
0.6
0.625
0.65
0.675
0.7
0.725
0.75
0.775
0.8
0.825
0.85
0.875
0.9
0.925
0.95
0.975 1
1.025
1.05
1.075
1.1
1.125
1.15
1.175
1.2
1.225
1.25
1.275
1.3
1.325
1.35
1.375
1.4
1.425
1.45
1.475
1.5
1.525
1.55
1.575
1.6
1.625
1.65
1.675
1.7
1.725
1.75
1.775
1.8
1.825
1.85
1.875
1.9
1.925
1.95
1.975 2
TE=50ns TE=50ns
1s
TE=200nsTE=200ns
1s
TE=350nsTE=350ns
1s
Reverse Sync Method
DUT(Slave) TESTER(Master)
T1Sync
T2Sync
Norm
algPTP
Ope
ratio
n
T1SyncReverse
T2SyncReverseRe
verse
Messages
1. SlavecalculatespathdelaytoMaster
2. SlavesynchronizestoMaster
3.MastercalculatespathdelaytoSlave
5.MastercalculatestimeerrorofSlave
TheReverseSyncMethod1. Theslavesynchronizesit’s
timetothemaster2. TheReverseSyncisenabled
ontheslave(testmode)3. TheMaster(tester)calculates
thepathdelaysothatitcanaccountforthiswhenvalidatingthesyncmessages
4. TheslavesendsSyncmessagesinthereversedirection(usingadifferentdomain)
5. Observations:theTESTER(Master)willcalculatethetimeerrorintherecoveredclockoftheDUT(Slave)
Adjust Reverse Sync rate for better samplingDUT(Slave) TESTER(Master)
1Sync
Interval
1Sync
Interval
1Sync
Interval
1Sync
Interval
90%Sync
Interval
90%Sync
Interval
90%Sync
Interval
90%Sync
Interval
90%Sync
Interval
90%Sync
Interval
ReverseSync
90%Sync
Interval
ReverseSync
Advantages of Reverse Sync for Integrated Devices• OnintegrateddevicesthathaveanintegratedSlaveandBridge,thereisnoobservabilityoftheSlavePdelay
mechanism• UsingSyncmessagesasEgress,theBridgecancorrectforthe“residencetime”oftheReverseSyncthesamewayas
theywouldnormallydoforthestandardgPTPinstance⁻ ThebridgejustforwardstheReverseSync(withtimingcorrections)toitsMasterporttotheTester⁻ Thisiseffectivelyusingfunctionalitydefinedin802.1AS-rev,usingonedomainforSynchronizationandadifferent
domaintodotherecoveredclockmeasurement• IfpropertimeissetinReverseSyncpreciseOriginTimestamp thereisnoneedforadditionalegressTLV• Implementationisstraightforward– canbedonefromexisting“SendSync”code
Slave TESTER(Master)Bridge
DUT:IntegratedECUwithSlave+Bridge
ResidenceTime
Summary
It is important to test 802.1AS slave clock accuracy
Multiple methods are now defined allowing slave clock accuracy to be measured including- 1PPS- Ingress Method- Egress Method- Reverse Sync Method
It is recommended to implement multiple methods to cross-check results
Summary: Advantages & Disadvantages of Each Method
Method Advantages Disadvantages
1PPSoutputs • Knownindustrystandard• Onlyanoscilloscopeisneededtomakethis
test
• Hardtovalidateimplementation• Notavailableonalldevices• DUTsmustbeclosetogether• Notpracticalforlarge-scaletesting
IngressMethod • Reportingcanbedonein-band• Noneed forextracapabilitiesontheSlave
• SamplingoftimeerrorisdependentonthetimingofincomingSyncmessages
• TheSlavecanreportavaluethatisnottheactualone
EgressMethod • Testerevaluatestheerror,itdoesnotrelyontheSlavetoreportit
• Reportingcanbedonein-band• Timeofreportingisdecoupledfromthe
receivetimeoftheincomingSyncmessages
• Complicatedtouseindeployednetworks–needssupportfromdirectlyconnectedMasterofDUT
ReverseSync • Alladvantages ofegressmethod,plus• Canbeusedonintegrateddevices• NoneedforadditionalegressTLV• Implementationisstraightforward
• Requires SyncgenerationonSlave
Questions?