BRKIOT-2517.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
BRKIOT-2517 Precision Time Protocol - deep dive and use cases Subtitle goes here Albert Mitchell January 2019 Agenda Basics of PTP • PTP Messaging • Grandmaster clock • PTP Profiles • Boundary and Transparent Clocks Configuring PTP on Cisco IE Switches • Profile, modes and changing the defaults Troubleshooting: How to know its working? • Show commands • Debug commands • Vlan impacts • Spanning tree issues Close BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 3 Perspective for PTP Breakout session • This Training oriented towards Network Administrator needing to configure PTP in the network. • Not a PTP expert, yet responsible to implement • The session covers • What is PTP • How to configure on the Cisco Industrial Ethernet Bridges • How to Troubleshoot problems BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 4 PTP Timing Distribution Architecture • PTP uses a hierarchical master-slave architecture for clock distribution. GPS • Grandmaster clock (GMC) is the root timing reference. It transmits Antenna synchronization information to the clocks residing on its network segment. • Ordinary clock (OC) is a device with a single network (PTP) connection and is either the source of (master) or destination for (slave) a synchronization Grandmaster reference. • Boundary clock (BC) has multiple network (PTP) connections and can M White VLAN accurately bridge synchronization from one network segment to another. • ‘M’ – interface in Master sate Boundary • ‘S’ – interface in Slave State Clock S S • Clocks in cascaded topologies: Transparent Ordinary • End-to-end transparent clock (E2E) Clock Clock • Peer-to-peer transparent clock (P2P) M M Red VLAN Green VLAN • PTP epoch is the same as Unix time (Midnight, 1 January 1970). • Using UTC with PTP is subject to leap seconds. S S S S S • PTP uses TAI (Temps Atomique International) time scale and moves forward monotonically. • TAI is currently ahead of UTC by 35 seconds. • TAI is always ahead of GPS by 19 seconds. • The PTP grandmaster communicates the current offset between UTC and Ordinary Clocks TAI so that UTC can be computed from the received PTP time. BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 5 PTP messages Have you seen this diagram? Master Slave t1 Sy F nc ol Delay low -U 1 p ( t1) t2 • What does this mean? t3 eq l_R • How can I use this? Delay De 2 t4 De l_R es p ( t4) BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 7 But first, Well used Terms in PTP • Common terms used throughout the session. • Good for a reference BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 8 PTP Terms • PTP –precision time protocol • GMC – Grand Master Clock (Master) • BC – boundary clock • TC – Transparent clock • OC – Ordinary clock (eg: slave) • E2E TC – End to End Transparent clock • P2P TC – Peer to Peer transparent clock • PDV – packet Delay Variation • M – designates an interface is in Master mode • S – designates an interface is in Slave Mode BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 9 Event Messaging in PTP master and slave Event msgs are timed. • Sync – master to all slaves, contains time • Announce – used by BMCA to build clock hierarchy select GMC • Follow_Up – master to all slaves, contains time t1; only in two-step • Delay_Request (E2E only)– Slave to master, requests delay time • Pdelay_Req (P2P only) slave Peer asking for per hop delay from Master BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 10 PTP Protocol General messages General messages are untimed • Follow_Up master to all slaves, contains time t1; only in two-step • Delay_Resp, (E2E only) Master to Slave, responds with time t4 • Pdelay_Resp_Follow_Up (P2P only) • Management • Signaling • Pdelay_Req, Pdelay_Resp and Pdelay_Resp_Follow_Up are used by Peer-to- Peer Transparent Clocks to measure delays across the network so that they can be compensated for by the system. BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 11 PTP Synchronization Message Exchange 1. It startsMaste whenr Master clockSla vsendse ‘Sync’ message. 1. ‘t1’ is timestamp when it leaves master 2.t1 In one-step ‘t1’ in Sync message 3. In two-step,Sy ‘t1’ in Follow-up message F nc 2. Slave receivesol ‘Sync’ at ‘t2’. Delay low -U 1 3. Slave sends ‘Delay_Reqp ( ’ message t1) 1. ‘t3’ is timestamp when it leavest2 slave 4. Master receives ‘Delay_Req’ at ‘t4’ 5. Master responds with ‘Delay_Respt3 ’ eq 1. contains ‘t4’ l_R Delay De 2 Slave needs t3 and t4 timestamps for delay t4 MeanPathDelay = ((t - t ) + (t - t ))/2 De 2 1 4 3 l_R es p ( Offset = t2 – t1 – MeanPathDelayt4) Offset = difference between the master and slave clock BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 12 Calculating Delay Mean Mpathaster Delay = ((tS2la–vet1)+(t4 – t3))/2 t1 Mean path DelaySyis really an Average F nc ol Delay low -U 1 p ( An assumption is made:t1) t2 Delay 1 = Delay 2 t1, t2 t3 eq l_R AssumptionDelay is usuallyDe wrong 2 (to some degree) t4 De Protocol Mechanismsl_R can correct es p ( for known Asymmetryt4) t1, t2, t3, t4 Asymmetry cannot be detected BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 13 Calculating Time Offset Delay = ((t2 – t1)+(t4 – t3))/2 Master Slave t1 Sy F nc Offset = ((t2 –ol t1)-(t4 – t3))/2 Delay low -U 1 p ( Offset = (Delay1–Delay2)/2t1) or t2 t1, t2 Offset = Master Time – Slavet3 Time – Delay eq l_R Delay De In other2 words: t4 De l_R es When Ordinary clockp is Frequency Locked (t4 and you assume Delay1) = Delay2, then any t1, t2, t3, t4 difference is due to error in Time (Offset). BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 14 Packet Delay Variation (PDV) PDV is primarily due to Varying Queue Delays at each hop… Packet Network Master Hop 1 Hop 2 Hop 3 Hop 4 Hop n Slave PTP SessionSession Even High Priority packets get behind a 1518 from time to time. The variance comes from the fact that sometimes you do and sometimes you don’t. It’s all statistics… BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 15 PTP Message rates Message Power profile Default profile Announce 1 Second 2 second intervals Sync 1 Second 1 Follow-up ( two step only) Triggered by Sync Triggered by Sync Delay Request NA 32 seconds to slaves from BC/GMC* Delay Response NA Triggered by Delay request Peer Delay Request 1 second; NA 802.1AS = 8 / second Peer Delay Response Triggered by Peer Delay request NA ‘*’ burst at beginning then fall back,path delay should not change BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 16 PTP messaging End to End Time Synchronization across the network How PTP works to distribute time using messages GPS Antenna A ‘typical’ Ethernet network topology Grandmaster A single PTP Domain M S Transparent Transparent Clock Clock M M Boundary Clock Transparent Clocks S S S S S Ordinary Clocks BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 18 Synchronization across the network - Sync GPS ‘Sync’ from GMC to all Ordinary Clocks (slaves) Antenna throughout the PTP Domain Grandmaster Clock 1. Starts from GMC M sync 2. Passed to from Master Ports to Slave ports by S sync sync network devices Transparent Transparent Clock M Clock BC M 3. Arrives at Ordinary Clocks Boundary sync Clock sync sync Transparent Clocks sync sync sync S S S S S Ordinary Clocks BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 19 Synchronization across the network – Delay Req GPS Delay Request from all Ordinary Clocks toward GMC Antenna throughout the PTP Domain Grandmaster Clock 1. Starts at ordinary clocks M Delay_Req 2. Passed to from Slave Ports to Master ports by S Delay_Req network devices Delay_Req Transparent Transparent Clock M Clock BC M 3. Delay_Req stop at the Boundary Clock Boundary Delay_Req Clock Delay_Req Delay_Req 1. BC initiates its own Delay_Req Transparent Clocks Delay_Req Delay_Req S S S S S Ordinary Clocks BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 20 End to End Sync Msg – 2 Step Ordinary Clock GMC E2E TC E2E TC link link or link BC SYNC t1 path delay (pd) SYNC Residence Follow up Time (rt) (contains t1) T1 not modified by SYNC Residence E2E TCs Time (rt) Follow up (contains t1 , rt , pd) t2 Follow up Follow up Contains t1, and All Delay (contains t1, - except path delay of last hop sum of all rt, OC must compute its own sum of all pd) path delay on last hop ‘rt’ of SYNC carried in correction field of Follow_Up BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 21 End to End Delay_Req and Delay_Resp – 2 Step Ordinary Clock GMC E2E TC E2E TC link link or link BC Delay_Req Residence t Time (rt) 3 T3 not Delay_Req modified by Residence Time (rt) E2E TCs Delay_Req t4 Master responds with T4 Delay_Resp (contains T4) Delay_Resp (contains T4, rt for T3) Delay_Resp (contains T4, sum of rt for T3) ‘rt’ of Delay_Req carried in correction field of Delay_Resp BRKIOT-2517 © 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public 22 Peer to Peer Transparent Clock – Sync and Delay P2P MASTER Transparent SLAVE Master time = TM Clock Slave time = TS t = TM + offset 1 SYNC Offset = ((t2 – t1)–(t4 – t3))/2 Residency Time (rt) SYNC Offset = (t2 – t1) pt1 pDelay_Request – PD2 t 2 – correctionField pt 2 pDelay_Request pt1 pt 3 pDelay_Response pt2 correctionField = PD1 + rt pt4 pt 3 pDelay_Response PD : meanPathDelay pt PD1= ((pt2 – pt1)+(pt4 – pt3))/2 4 PD2= ((pt2 – pt1)+(pt4 – pt3))/2 BRKIOT-2517 © 2019 Cisco and/or its affiliates.