Five Minute Facts About Packet Timing
By Doug Arnold.
If you are new to the exciting world of IEEE 1588, or even if you are not, you might find yourself confused by all of the different types of clocks. I’ve heard and seen the following terms used related to PTP:
- ordinary clock
- master clock
- slave clock
- slave only clock
- grandmaster clock
- preferred grandmaster
- transparent clock
- boundary clock
What the heck! Is PTP really that complicated? Certainly that appears like a lot of device types, but we can sort this out quickly.
Let’s start with an ordinary clock. This is an end device on a network (as opposed to a switch or router). It comes in three flavors:
- Slave only clock. This one is pretty self explanatory, it always acts a slave, receiving time from a master clock.
- Preferred grandmaster. This is a device which only acts as a master, never as a slave. Usually such a device is referred to simply as a grandmaster. Generally a grandmaster has a good oscillator and the ability to get standard time, for example from a GPS receiver. One has to be careful though since the IEEE 1588 standard considers grandmaster to be a state of a grandmaster capable device, i.e. the state when it is acting as the source of time in a PTP network.
- Master clock or slave clock. This kind of ordinary clock can act as either a master or slave. Usually it acts as slave unless there is no better master available in the network, in which case it takes over that function and becomes the grandmaster.
Some people don’t like to use the terms master and slave, since it reminds them of ugly aspects of human culture and history. So instead they prefer to use the terms server and client. However, traditionally in information technology a client initiates a transfer of information by asking a server for the information. Think of a web browser (client) and web server. In contrast a slave is more passive and waits for the master to initiate the transfer. So there is value in preserving the distinction between the two pairs of terms. I will make the following moral statement: When people are masters and slaves, it is bad. When electronic devices are masters and slaves, it is just fine.
OK, enough about that. We still have two kinds of clocks to define, and they are, in some ways, the most interesting. As I mentioned in an earlier post, PTP achieves accuracy when hardware timestamping is used. This allows us to circumvent the unpredictable delays in queues. Well folks the worst queuing noise is often in the switches and routers. So IEEE 1588-2008 has defined two types of switches (or routers) which specifically deal with their own queues. One device is called a transparent clock. This type performs hardware timestamps whenever a sync message arrives or departs the transparent clock. Consider the transparent clock block diagram shown below. A sync message enters the device, a hardware time stamp is generated it then enters the core switching element and departs through a different network port. While in the core switching element it might have to wait in a queue, since the port it needs to leave could be busy. The departure and arrival timestamps are used to update the correction field in the follow_up message. This is how it works for a two step transparent clock. If the transparent clock is a one-step clock, it updates the sync message, which also has a correction field, on the fly instead. More on one-step clocks in a future post. Note also that in a network which uses the peer delay scheme the ingress cable delay is also added to the correction. In a network which use end-to-end scheme a similar correction is made to a delay_response message to correct for the queuing of the delay_request message.
A boundary clock has another way of removing the effects of its own queues. A boundary clock has one port which is in a slave state, getting time from a master clock. All other ports are in a master state which disseminate time to downstream slaves. So instead of tracking sync messages and updating correction fields it absorbs sync messages in the slave port, uses that port to sets its clock, and generates new sync messages from this clock out of all of its master ports. Note that the master ports, are masters, but not grandmasters, since they are merely re-timing from an upstream grandmaster or boundary clock. See the diagram below.
- boundary clock
- transparent vs boundary clock
- transparent clock ptp
- 1588 master clock
- what is a grandmaster device
- what is a boundary clock
- transparent ordinary and boundary clock
- ptp protocol boundary clock
- ptp modes transparent boundary
- ptp clock ieee