VIAVI TestCenter: How is offset calculated for IEEE1588v2 in 2-step mode?

Knowledge Base - FAQ

VIAVI TestCenter: How is offset calculated for IEEE1588v2 in 2-step mode?
• In order not to get those large offset when the clock are starting to sync, STC ignores the first offset for calculation. • So at the start, if our clock is say 1 hour behind the master, we don’t show a 1 hour offset as that would only skew future calculations of the offset deviation and offset standard deviation. • After the first offset is ignored, we calculate offset according to section 11.2 of the IEEE 1588v2 spec, that is: • = ─ ─ ─ correctionField of Sync message ─ correctionField of Follow_Up message.   • Here is how the STC (slave) gets the local clock to know for the second offset calculation. • The slave basically takes the follow up timestamp subtract off the sync receive timestamp and use that as the wall time.  • Then whenever a subsequent sync is received, VIAVI adds the receive timestamp for that message to get our .   • So wall time is the time of day that the slave thinks it the correct time less the rx timestamp. So when the slave get the time from the master in either the sync or follow up message, it basically takes that time, adds in the mean path delay, and any correction fields in the last sync or follow up messages.  Then it subtracts the receive timestamp for that sync/follow up message to give it a wall time.  So now whenever it receives another packet, it adds the receive timestamp to the previous wall time to give the current time of day on the slave clock.  • Here’s an example: Sync message is received on slave, rx timestamp is 5 secs. Follow Up message is received on slave, timestamp in message shows the time sync was sent to be 1000 secs from epoch ( or whatever time you want).  Mean path delay is .5 seconds. Slave clock sets base time to 995.5 sec from epoch. Sync message is received on slave, rx timestamp is 6 secs.  So the time of day the slave thinks it received the message is 995.5 + 6 or 1001.5 seconds from epoch. • So basically we are using the rx timestamp to give our slave a ticking clock. That’s why it was said we subtract off the rx timestamp of the sync but add it back on the next one to give us the accurate time of day for the slave.