.... IEEE 1588 2010 7 8 ( ) IEEE 1588 2010 7 8 1 / 23
...1 What?...2 Why?...3 How? ( ) IEEE 1588 2010 7 8 2 / 23
...1 What?...2 Why?...3 How? ( ) IEEE 1588 2010 7 8 3 / 23
IEEE 1588 ( ) IEEE 1588 2010 7 8 3 / 23
IEEE 1588 IEEE 1588 ( ) IEEE 1588 2010 7 8 3 / 23
IEEE 1588 IEEE 1588 IEEE 1588 ( ) IEEE 1588 2010 7 8 3 / 23
...1 What?...2 Why?...3 How? ( ) IEEE 1588 2010 7 8 4 / 23
: SNTP RFC2030 50ms-150ms NTP RFC1305 500us-50ms PTP IEEE 1588 ( ) IEEE 1588 2010 7 8 4 / 23
1588 ( ) IEEE 1588 2010 7 8 5 / 23
1588 <1us ( ) IEEE 1588 2010 7 8 5 / 23
1588 <1us GPS IRIG-B ( ) IEEE 1588 2010 7 8 5 / 23
1588 <1us GPS IRIG-B BMC ( ) IEEE 1588 2010 7 8 5 / 23
1588 <1us GPS IRIG-B BMC ( ) IEEE 1588 2010 7 8 5 / 23
1588 <1us GPS IRIG-B BMC GPS ( ) IEEE 1588 2010 7 8 5 / 23
...1 What?...2 Why?...3 How? ( ) IEEE 1588 2010 7 8 6 / 23
IEEE 1588 v2 : PTP Ordinary/Slave Clock Grandmaster Clock Boundary Clock Transparent Clock BMC sync Message follow-up Message announce message one step operation two step operation delay-req/resp msg pdelay-req/resp msg point to point (P2P) 1588 OC OC MC MC->OC MC(s) advertise capabilities to enable BMC On the fly manipulation of 1588 packets by MC and TC ( ) IEEE 1588 2010 7 8 6 / 23
IEEE 1588 ( ) IEEE 1588 2010 7 8 7 / 23
( ) IEEE 1588 2010 7 8 8 / 23
( ) IEEE 1588 2010 7 8 8 / 23
Qos ( ) IEEE 1588 2010 7 8 8 / 23
Qos 100Mbps 64 5us ( ) IEEE 1588 2010 7 8 8 / 23
Qos 100Mbps 64 5us 100Mbps 1500 120us ( ) IEEE 1588 2010 7 8 8 / 23
Qos 100Mbps 64 5us 100Mbps 1500 120us OC ( ) IEEE 1588 2010 7 8 8 / 23
Qos 100Mbps 64 5us 100Mbps 1500 120us OC 1588 v2 --- --- ( ) IEEE 1588 2010 7 8 8 / 23
( ) IEEE 1588 2010 7 8 9 / 23
100 102 104 106 108 110 Estimated Send Time (100) Precise Send Time (101) B Precise Receive Time (108) Master Clock PTP Appl. G/MII t 0 SYNC(100??) FOLLOW_UP(101!) DELAY_REQ t 3 t 2 DELAY_RESP(108) Slave Clock G/MII PTP Appl. t 1 A Precise Receive Time (106) Offset Computation Precise Send Time (111) 104 106 108 110 112 114 112 Key Equations: A = t 1 t 0 = Delay + Offset B = t 3 -t 2 = Delay Offset Delay = (A+B) / 2 Offset = (A-B) / 2 Example: A = 106 101 = 5 B = 108 111 = -3 Delay = (5-3) / 2 = 1 Offset = (5+3) / 2 = 4 IEEE 1588 Synchronization Message Sequence 116 UDP port 319: Sync and Delay_Req UDP port 320: Follow_up, Delay_Resp, and Mgmt ( ) IEEE 1588 2010 7 8 10 / 23
( ) IEEE 1588 2010 7 8 11 / 23
End-to-End Master Transparent Clock Slave T1 Sync Follow_up Sync Follow_up T2 Delay_Req T3 Delay_Req T4 Delay_Resp Delay_Resp End to End residence time correction model Delay request-response path length measurement ( ) IEEE 1588 2010 7 8 12 / 23
Peer-to-Peer Master Transparent Clock Slave T1 Sync Follow_up Sync Follow_up T2 T4 T5 PDelay_Req S-TC PDelay_Resp TC-S T3 T6 PDelay_Req TC-M PDelay_Resp_Follow_Up TC-S PDelay_Resp M-TC PDelay_Resp_Follow_Up M-TC Peer to Peer residence time and link delay correction model S-TC : Slave to Transparent Clock M-TC : Master to Transparent Clock Peer delay link measurement ( ) IEEE 1588 2010 7 8 13 / 23
Peer-to-Peer Residence time = t r1 Residence time = t r2 GM Ordinary Clock-0 P2P TC Propagation time = t p0 S Ordinary Clock-1 P2P TC Propagation time = t p1 S Ordinary Clock-2 P2P TC Link 1 Link 2 Link 3 Propagation time = t p2 S Ordinary Clock-3 P2P TC N 1 Sync correction field + Follow Up correction field = (t ri + t pi ) (1) N 1 N total propagation plus residence time = t ri + t pi (2) i=1 i=1 i=1 slave offset = t 2 t 1 total propagation plus residence time (3) ( ) IEEE 1588 2010 7 8 14 / 23
E2E vs. P2P + Scale poorly with the number of devices (master sees all slaves) + Good for linear systems (eliminates cascaded servos) Can introduce 1:N topology + + Scale well with the number of devices + Good for linear systems (large number of daisy chained clocks) + Rapid recovery with changes in network topology Cannot resolve 1:N introduced by ordinary switches, wireless, or end-to-end TC Must maintain per port path length state and measuring mechanisms. Only used in homogeneous P2P systems. Requires a boundary clock at the edges. 6 (vs. 4) measurements ( ) IEEE 1588 2010 7 8 15 / 23
IEEE 1588 Now, it's 9:28! Milliseconds of delay and variation introduced by protocol stack Master Clock PTP UDP IP MAC PHY Variable delay introduced by the Network due to the topology: Hundreds of nanoseconds to microseconds for repeaters & switches Milliseconds for routers Network Slave Clock PTP UDP IP MAC PHY OK, thanks 9:28! Milliseconds of delay and variation introduced by protocol stack PTP Packet Now it's 9:28 Software Timestamp Implementation ( ) IEEE 1588 2010 7 8 16 / 23
IEEE 1588 Master Clock Slave Clock Now, it's PTP PTP OK, thanks 9:28! UDP UDP IP IP MAC MAC PHY Network PHY 9:28! PTP Packet Now it's 9:28 Hardware Timestamp Implementation ( ) IEEE 1588 2010 7 8 17 / 23
PTP Message Header PTP Message Header Bits 7 6 5 4 3 2 1 transportspecific messagetype reserved versionptp messagelength domainnumber reserved flagfield correctionfield reserved sourceportidentity sequenceid controlfield logmessageinterval 0 Octets Offset 1 0 1 1 2 2 1 4 1 5 2 6 8 8 4 16 10 20 2 30 1 32 1 33 ( ) IEEE 1588 2010 7 8 18 / 23
: Message Type Message Type Message Class Value Sync Event 0 Delay Req Event 1 Pdelay Req Event 2 Pdelay Resp Event 3 Reserved 4 7 Follow Up General 8 Delay Resp General 9 Pdelay Resp Follow Up General A Announce General B Signaling General C Management General D Reserved E F ( ) IEEE 1588 2010 7 8 19 / 23
Value of flagfield : Value of flagfield Octet Bit Message types Name 0 0 Announce,Sync,Follow Up,Delay Respon alternatemasterflag ( ) IEEE 1588 2010 7 8 20 / 23
Announce Message Annouce Message 7 6 5 4 Bits 3 2 1 0 Octets Offset header 34 0 origintimestamp 10 44 currentutcoffset 2 46 reserved 1 47 grandmasterpriority1 1 48 grandmasterclockquality 4 40 grandmasterpriority2 1 52 grandmasteridentity 8 53 stepsremoved 2 61 timesource 1 63 ( ) IEEE 1588 2010 7 8 21 / 23
Sync and Delay Req messages Sync and Delay_ReqmessagesMessage 7 6 5 4 Bits 3 2 1 0 Octets Offset header 34 0 origintimestamp 10 44 ( ) IEEE 1588 2010 7 8 22 / 23
Thank you! Author: Address: Email: Zheng Xiao-jun No.11 Phoenix Road of Jiangning Development Zone Guodian Nanjing Automation CO.,LTD Nanjing, 211100, China zxj@sac-china.com ( ) IEEE 1588 2010 7 8 23 / 23