最为我们熟悉的时间同步协议是NTP,配置起来相对简单,并不复杂;但是NTP实现的毫秒级的时间同步,在普通的网络中只是用来实现网络时间的同步管理。在5G网络中需要一种更为精确的时间同步协议,所以这个文章记录下微妙级的时间同步协议-PTP配置案例。

网络元素
- Grandmaster (GM) :时间源设备, 所为其他网络设备提供计时,并且不将其本地时钟与其他网络设备同步。
- T-BC(Boundary Clock):边界时钟, 将其本地时钟与T-GM或上游T-BC时钟同步,并向下游T-BC或T-TSC时钟提供时序信息。
- T-TSC: time slave clock, 从时钟将其本地时钟与另一个PTP时钟同步,但不向任何其他网络设备提供PTP同步。
设备端口状态
| INIT | Port is not ready to participate in PTP. |
| LISTENING | First state when a port becomes ready to participate in PTP: In this state, the port listens to PTP masters for a (configurable) period of time. |
| PRE-MASTER | Port is ready to enter the MASTER state. |
| MASTER | Port provides timestamps for any Slave or boundary clocks that are listening. |
| UNCALIBRATED | Port receives timestamps from a Master clock but, the router’s clock is not yet synchronized to the Master. |
| SLAVE | Port receives timestamps from a Master clock and the router’s clock is synchronized to the Master. |
| PASSIVE | Port is aware of a better clock than the one it would advertise if it was in MASTER state and is not a Slave clock to that Master clock. |
NCS55 G82751 配置案例
T-GM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | RP/0/RP0/CPU0:PE2-NCS55A2-A#show run ptpSat Aug 22 16:11:00.559 UTCptp clock domain 24 profile g.8275.1 clock-type T-GM identity mac-address 0100.4817.6033 clock-class 6 ! profile g82751_any multicast transport ethernet sync frequency 16 announce frequency 8 delay-request frequency 16 ! log servo events best-master-clock changes !!RP/0/RP0/CPU0:PE2-NCS55A2-A#RP/0/RP0/CPU0:PE2-NCS55A2-A#RP/0/RP0/CPU0:PE2-NCS55A2-A#show run frequency synchronization Sat Aug 22 16:11:09.727 UTCfrequency synchronization quality itu-t option 1 log selection changes! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | RP/0/RP0/CPU0:PE2-NCS55A2-A#show ptp interfaces brief Sat Aug 22 16:12:44.308 UTCIntf Port Port LineName Number State Encap State Mechanism--------------------------------------------------------------------------------Te0/0/0/8 1 Master Ethernet up 1-step DRRMRP/0/RP0/CPU0:PE2-NCS55A2-A#RP/0/RP0/CPU0:PE2-NCS55A2-A#RP/0/RP0/CPU0:PE2-NCS55A2-A#show run int tenGigE 0/0/0/8Sat Aug 22 16:12:50.416 UTCinterface TenGigE0/0/0/8 ptp profile g82751_any ! ipv4 address 10.99.1.2 255.255.255.252 frequency synchronization wait-to-restore 0 quality transmit exact itu-t option 1 PRC !! |
T-BC
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | RP/0/RP0/CPU0:NCS5516-B#show run ptp Sat Aug 22 16:37:52.667 UTCptp clock domain 24 profile g.8275.1 clock-type T-BC priority2 100 clock-class 165 ! profile g82751_any multicast transport ethernet sync frequency 16 announce frequency 8 delay-request frequency 16 ! time-of-day priority 99 physical-layer-frequency log servo events best-master-clock changes !!RP/0/RP0/CPU0:NCS5516-B#show run frequency synchronization Sat Aug 22 16:38:06.764 UTCfrequency synchronization quality itu-t option 1 log selection changes! |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | RP/0/RP0/CPU0:NCS5516-B#show run int tenGigE 0/1/0/0 Sat Aug 22 16:38:57.615 UTCinterface TenGigE0/1/0/0 ptp profile g82751_any port state slave-only ! ipv4 address 10.99.1.1 255.255.255.252 frequency synchronization selection input priority 10 wait-to-restore 0 !!RP/0/RP0/CPU0:NCS5516-B#show ptp interfaces brief Sat Aug 22 16:39:01.662 UTCIntf Port Port LineName Number State Encap State Mechanism--------------------------------------------------------------------------------Te0/1/0/0 1 Slave Ethernet up 1-step DRRMTe0/1/0/1 2 Master Ethernet up 1-step DRRMHu0/0/0/34 4 Master Ethernet up 1-step DRRMHu0/0/0/35 3 Master Ethernet up 1-step DRRM |
The blog from link: http://imxing.cn/wp-trackback.php?p=827