Sunday, July 7, 2013

CCIE DC: PTP

Hi Guys

PTP is a protocol used for absolutely incredibly correct time keeping, it stands for precision time protocol.

It is in the CCIE DC Lab Blueprint so hence I am covering it off here, it's not TOO complicated and there is not TOO much config, this picture below should help us discuss the aspects of it:



Let's go through it!

OK, so first of all, PTP uses a protocol called PTP Timing messages to exchange the clock information, there is what is known as a PTP domain and this is used to group together devices into a single PTP instance, on NX-OS 5.2 only one instance is supported.


There are three types of "clocks" in PTP:

an "original" clock, which is a just a normal clock that keeps time and can also be the "Grandfather clock" (more on this later)

A boundary clock, which is basically a clock that provides or receives time from other clocks, and finally a transparent clock, which is a device that does not actively participate in PTP but DOES allow PTP timing messages to go through it, and even calculates the time the PTP message took to get through and includes that in the timing message (so the time it took for the frame to go through the switch).

Currently, NXOS only supports boundary clock, and only on F1 linecards.

The PTP system works on a heirachy, with the grandfather clock at the top, and all the member devices getting there time from this one true source, the traffic is multicast downwards on Mcast address  224.0.1.129:


N7K-1-1# show ip mroute
IP Multicast Routing Table for VRF "default"

(*, 224.0.1.129/32), uptime: 00:30:26, igmp ip
  Incoming interface: Null, RPF nbr: 0.0.0.0
  Outgoing interface list: (count: 1)
    Vlan1, uptime: 00:30:26, igmp


The Grandfather clock is selected based on priority, two priority values can be configured, 1 and 2. With 2 acting as a tie-breaker.


It is very easy to turn on PTP and configure it.

First of all, enable the feature:


feature ptp







Next, configure a PTP priority value for the device that is going to act as the grandfather clock, in my example I used priority 2 (the tiebreaker priority) to select the grandfather clock.



ptp priority2 10







Next, you must specify a source for the PTP:


ptp source 169.254.1.2

Finally, we enable the interface to support PTP:

Note as of writing this is F1 and F2 linecards only:


interface Ethernet1/1
  ptp
  no shutdown

Do this on both directions on the port i.e. on the switch connected at one end and the switch connected at the other.


Let's get some info:


N7K-1-1# show ptp clock
PTP Device Type: Boundary clock 

Here we can see what kind of clock we are

Clock Identity :   0:24:98:ff:fe:e8: 1:c2
Clock Domain: 0



Number of PTP ports: 1
Priority1 : 255
Priority2 : 255


This is our priority

Clock Quality:
        Class : 248
        Accuracy : 254
        Offset (log variance) : 65535
Offset From Master : -1372117536
Mean Path Delay : 4804
Steps removed : 1
Local clock time:Sun Jul  7 16:45:50 20



Let's look at the actual grandfather clock:

N7K-1-2(config)# show ptp clock
PTP Device Type: Boundary clock
Clock Identity :   0:1b:54:ff:fe:c2:67:c2
Clock Domain: 0
Number of PTP ports: 1
Priority1 : 255
Priority2 : 10
Clock Quality:
        Class : 248
        Accuracy : 254
        Offset (log variance) : 65535
Offset From Master : 0
Mean Path Delay : 0
Steps removed : 0
Local clock time:Sun Jul  7 12:41:26 2013
N7K-1-2(config)#


Notice the offset from master etc shows 0, because we ARE the master.



N7K-1-2(config)# show ptp parent

PTP PARENT PROPERTIES

Parent Clock:
Parent Clock Identity:   0:1b:54:ff:fe:c2:67:c2
Parent Port Number: 0
Observed Parent Offset (log variance): N/A
Observed Parent Clock Phase Change Rate: N/A

Grandmaster Clock:
Grandmaster Clock Identity:   0:1b:54:ff:fe:c2:67:c2
Grandmaster Clock Quality:
        Class: 248
        Accuracy: 254
        Offset (log variance): 65535
        Priority1: 255
        Priority2: 10






We can tell where our port fits in the heirachy:

7K-1-1# show ptp brief

PTP port status
-----------------------
Port         State
-------  --------------
Eth1/1      Slave
N7K-1-1#


On the grandmaster clock:

N7K-1-2(config)# show ptp brief

PTP port status
-----------------------
Port         State
-------  --------------
Eth1/1      Master




3 comments:

  1. Hi Peter, I'm not sure if the official documentation changed since you wrote this, but in the official "Cisco Nexus 7000 Series NX-OS System Management Configuration Guide, Release 5.x" it states that you're able to actually configure more than one instance/domain with "ptp domain 1" for example.

    Also, that same guide states that "NX-OS Release 5.2, PTP operates only in boundary clock mode", however, it also says that the port of an Ordinary Clock can function as a Grandmaster clock and that the ports of a Boundary clock can each behave like a port of an Ordinary Clock.

    I agree, it's convoluted, but it explains how you can configure a N7K to be the Source (Grandmaster clock) of other N7K devices in the same PTP domain.

    ReplyDelete