Thursday, October 17, 2013

Configuring PTP on an MX and a TCA 8500

So I'm configuring PTP (Precision Time Protocol).
I decided to create a cheat sheet/guide to help identify the important pieces.

Setup looks like this.

 TCA 8500 === 100m ethernet  === EX 4200 === MX104 ========= MX80-P
                                                                 ||               ||
                                                                 ||               ||
                                                                 ||===== MX240 ========= ACX

The TCA is connected to a GPS antenna and is the grand master clock (GMC).  (Note: Clock Class for GPS is 6, TCA in freerun is 52)

The big Caveat of the TCA is the ethernet port that supports PTP is 100M only! WTF?!
Some of the problems are that some Juniper GE gear is not tri-rate. The problem is that you need a "P" supported mic/MPC/Router and most are not tri-rate. MX80 has to be MX80-P. MPC has to be MPC with a "-P" in it, etc.  All ACXes support PTP.

Hence the addition of the EX4200 in the setup.

Next is configuring the MX104. I actually have two Masters. The MX240 is a boundary clock and connected to the TCA and will provide a backup in case the connection between the MX104 and EX 4200 goes down.

user@router# show protocols ptp
clock-mode boundary;
priority1 1;
priority2 2;
domain 17;
slave {
    interface ge-1/1/0.0 {
        unicast-mode {
            transport ipv4;
            clock-source local-ip-address;
    interface xe-2/0/0.0 {
        unicast-mode {
            transport ipv4;
            clock-source local-ip-address;
master {
    interface ge-1/0/0.0 {            
        unicast-mode {
            transport ipv4;
            clock-client local-ip-address;

For this test we are using E1, not T1. So you need to change the signaling on the MX.

npr@router# show chassis
synchronization {
    network-option option-1;
    interfaces bits {
        signal-type e1;
        e1-options {
            framing g704;
    esmc-transmit {
        interfaces all;

The TCA also needs to support E1. You have the ability to boot this in E1 or T1 mode.

TCA8K# show partition
Partition 1 : TCA8K-3.0.0-7-PTP-T1

Partition 2 : TCA8K-3.1.0-5-PTP-E1(Active)

TCA8K# reboot ?
reboot [1/2]

TCA8K# show ptp config
                          Mode : Grandmaster
                     Port Type : Grandmaster
                 Domain number : 17
                       Profile : Telecom Profile
                     Priority1 : 0
                     Priority2 : 0
                      Two step : no
   Log Mean Delay Req Interval : 64 packet/sec
    Log Mean Announce Interval : 1 packet/2sec
        Log Mean Sync Interval : 64 packets/sec
      Announce Receipt Timeout : 3

TCA8K# show ptp unicast-config
                Mode : Grandmaster
           Port Type : Grandmaster
IP                       MAC                        Mode                       Active            64:87:88:25:55:4e          auto                       yes          

TCA8K# show gps

Receiver Description:     GPS
Receiver Status:          Good
Antenna Voltage:          5v
Cable Delay Compensation: 0 ns
Antenna Status:           GOOD
Position:                 37 24'29.6960'' N; 122 1'44.2603'' W;
Altitude:                 17.05 m
Satellite num:            11

Sat Number            Signal              Status
    18         10.600000AMU                Acquired
    25          2.800000AMU                Acquired
    16          5.800000AMU                Acquired
    29          9.400000AMU                Acquired
    21         10.600000AMU                Acquired
    26          8.400000AMU                Acquired
    22          5.800000AMU                Acquired
    15          7.600000AMU                Acquired
     5          8.400000AMU                Acquired
    26          5.200000AMU                Acquired
     8          7.600000AMU                Acquired

Next you need to make sure you are seeing the GMC clock id.

user@router# run show ptp clock
Clock Details:

Slot Number           : 1          
Default Data:
Two-step Clock        : FALSE                      Clock Identity : 64:87:88:ff:fe:25:5a:00
Total Ports on Device : 0                          Clock Class    : 52
Clock Accuracy        : 38                         Log Variance   : 15353
Clock Priority1       : 1                          Clock Priority2: 2
UTC Offset            : 35                         Leap59         : FALSE
Leap61                : FALSE                      Time Tracable  : FALSE
Frequency Tracable    : FALSE                      Time Source    : 0
Delay Req Sending Time: 0                          Steps Removed  : 1
Slave-only            : NA
Parent Data:
Parent Id             : f8:c0:01:ff:ff:08:c1:8e    
GMC Id                : f8:c0:01:ff:ff:08:c1:8e   GMC Class        : 6
GMC Accuracy          : 176                       GMC Variance     : 0  
GMC Priority1         : 0                         GMC Priority2    : 0
Global Data:
UTC Offset            : 35                        Leap-59          : FALSE
Leap-61               : FALSE                     Time tracable    : TRUE
Freq Traceable        : TRUE                      Time Scale       : TRUE
Time source           : 32
Parent ID is the upstream Master's clock id. If there was a Boundary clock between the TCA and MX, then we would see a different Parent ID from the GMC ID.

We're seeing the GMC ID which is the TCA and that means we're good.

GMC Class is 6. This indicates it's connected to a GPS. Higher number is a lower quality clock.

In my setup I have two "slave" configs. This doesn't tell me which one is the active slave that I learned the GMC. They both say "active"!

user@router# run show ptp slave        

PTP Slave Interfaces Configured:

Slave Interface             Status  
ge-1/1/0.0                  Slave, Active      
xe-2/0/0.0                  Slave, Active      

Luckily the clock id seems to be derived from the mac address.

user@router# run show arp no-resolve | match f8:c0:01
f8:c0:01:08:c1:8e   ge-1/1/0.0           none

notice the GMC ID/Parent ID has some bytes inserted into the mac "ff:fe"

GMC Id                : f8:c0:01:ff:fe:08:c1:8e

Another way to look at it is to see the port level.

user@router> show ptp port
PTP port-data:
Local IP          :  Remote IP         :
Clock Stream      : 0              Clock Identity    : 64:87:88:ff:fe:25:5a:00
Port State        : Slave          Delay Req Interval: -6
Announce Interval : 1              Announce Timeout  : 3
Sync Interval     : -6             Delay Mechanism   : End-to-end
Port Number       : 1              Operating Mode    : Master

Local IP          :    Remote IP         :
Clock Stream      : 5              Clock Identity    : 64:87:88:ff:fe:25:5a:00
Port State        : Master         Delay Req Interval: -6
Announce Interval : 1              Announce Timeout  : 3
Sync Interval     : -7             Delay Mechanism   : End-to-end
Port Number       : 6              Operating Mode    : Slave

Local IP          :    Remote IP         :
Clock Stream      : 5              Clock Identity    : 64:87:88:ff:fe:25:5a:00
Port State        : Listening      Delay Req Interval: -6
Announce Interval : 1              Announce Timeout  : 3
Sync Interval     : -7             Delay Mechanism   : End-to-end
Port Number       : 3              Operating Mode    : Slave

If the port state is Listening, then the router is not receiving sync from this other port. When failover happens (ie link break), the router will converge to the new slave.

Phase alignment will once again try to reacquire.

user@router# run show ptp lock-status  
Lock Status:

Lock State    : 3 (ACQUIRING)
Phase offset  : 0.000000043 sec

Should take a few minutes

user@router# run show ptp lock-status  
Lock Status:

Lock State    : 5 (PHASE ALIGNED)
Phase offset  : -0.000000001 sec

On the TCA:

TCA8K# show network
IP Address:     
IP Mode:                  static
MAC Addr:                 f8:c0:01:08:c1:8e
Domain:                   localhost
Speed:                    100 Mbps
Duplex:                   Full
Auto Negotiation          enabled
Status:                   up
VLAN:                     disable

Then when the MX is the Master for a downstream slave, you can see the clock-id is derived from the mac-address of the MX.

user@router# run show chassis mac-addresses
MAC address information:
  Public base address     64:87:88:25:52:00
  Public count            2032
  Private base address    64:87:88:25:59:f0
  Private count           16

Some troubleshooting commands:
 *) show ptp statistics detail
user@router# run show ptp statistics detail
Local Address    Remote Address     Role  Stream      Received  Transmitted     Slave       0      36778881     18319873
         Signalling    Announce        Sync       Delay       Error
   Rx:         3189       12033    18316138    18316449         184
   Tx:         3203           0           0    18316670           0

[Collect this show command three times, at the interval of 30 seconds each].

*) show ptp port detail
*) show chassis environment cb
*) show ptp slave detail

No comments:

Post a Comment