Page
1/16
Alexandre VAN KEMPEN
Gaël MACÉ
Table of Contents
1.
I
NTRODUCTION
3
1.1.
Purpose 3
1.2.
Abbreviations 3
2.
P
RECISION
T
IME
P
ROTOCOL
4
2.1.
Main differences between V1 & V2 4
2.1.1.
Messages 5
2.1.1.1.
M
ANAGEMENT MESSAGES
5
2.1.1.2.
S
IGNALING MESSAGES
6
2.1.1.3.
M
ESSAGES FORMAT
6
2.1.1.3.1.
Header 6
2.1.1.3.2.
Sync & Delay_req 7
2.1.1.3.3.
Follow_up (two-step clocks) 8
2.1.1.3.4.
Delay_resp 8
2.1.1.3.5.
Pdelay messages (exclusively 1588 V2) 9
2.1.1.3.6.
Announce messages (exclusively 1588 V2) 9
2.1.2.
Delay computing 10
2.1.3.
Clock types 10
2.1.3.1.
E
ND
T
O
E
ND
T
RANSPARENT
C
LOCK
11
2.1.3.2.
P
EER
T
O
P
EER
T
RANSPARENT
C
LOCK
12
2.1.4.
Extension mechanism (TLV) 13
2.2.
PTP V2 & 801.AS 13
3.
I
MPLEMENTATION
14
3.1.
PTPd v1 14
3.2.
PTPd v2 14
4.
A
PPENDICES
16
4.1.
References 16
Alexandre VAN KEMPEN
Page
2/16
Gaël MACÉ
Table of Figures
Figure 1 : State machine for a full implementation .................................................................................... 4
Figure 2 : The peer delay mechanism .................................................................................................... 10
Figure 3 : End to End residence time correction model........................................................................... 11
Figure 4 : Delay request-response path length measurement ................................................................. 11
Figure 5 : Peer to Peer residence time and link delay correction model .................................................. 12
Figure 6 : Peer delay link measurement ................................................................................................. 12
Figure 7 : Ptpd’s source code organization............................................................................................. 14
Alexandre VAN KEMPEN
Page
3/16
Gaël MACÉ
1. Introduction
1.1. Purpose
This document describes the implementation of the IEEE 1588-2008 (PTP V2) protocol which is a revision
of the Precision Time Protocol (PTP V1) as defined by the IEEE 1588-2002 standard. This implementation
will utilize an existing open source module called “Ptpd”. A specific profile of 1588 V2 will be used,
according to the 802.1AS requirements., Note that this document do not substitute for reading the IEEE
1588-2008 standard because it dictates most operations of this implementation.
1.2. Abbreviations
Use “Ctrl + Click” to go to definition when letter bookmark are present (ex. [1]).
- AVB: Audio Video Bridging
- BMCA: Best Master Clock Algorithm
- E2E TC: End to End Transparent Clock
- P2P TC: Peer to Peer Transparent Clock
- PTP: Precision Time Protocol
- TLV: Type, Length, Value (according to 802.1AVB)
Alexandre VAN KEMPEN
Page
4/16
Gaël MACÉ
2. Precision Time Protocol
The “Precision Time Protocol” (PTP), defines a method to precisely synchronize the system clock of
distributed nodes in a system using standardized packet based networks like Ethernet. The Precision
Time Protocol allows all nodes to synchronize system-wide in the sub-microsecond range.
2.1. Main differences between V1 & V2
Version 2 of the IEEE 1588 standard is a consistent improvement of version 1 to enhance the usability
and precision for large networks. To achieve these goals, V2 defines shorter synchronization frames to
save network bandwidth, transparent clocks to avoid exponential error propagation in cascaded networks
and many other new features, like message extensions (using TLV).
Version 2 is much more flexible regarding the configuration of the protocol by means of configuration sets
used by specific devices. These sets, known as “profiles”, simplify the configuration of the nodes and
guarantee the proper behavior and performance for specific systems. The implementation presented in
this document will mostly use a specific profile define in the IEEE 802.1AS standard.
The state machine of the protocol engine is described on the figure below. It is quite similar to the 1588 V1
one.
Figure 1 : State machine for a full implementation
Alexandre VAN KEMPEN
Page
5/16
Gaël MACÉ
2.1.1. Messages
There are five kinds of messages defined for PTPv1, and ten kinds in PTPv2.
PTP V1 PTP V2
Event messages
-Sync
-Delay_Req
-Sync
-Delay_Req
-Pdelay_Req
General messages
-Follow_Up
-Delay_Resp
-Management
-Announce
-Follow_Up
-Delay_Resp
-PDelay_Follow_Up
-PDelay_Resp
-Signaling
-Management messages
The Pdelay_Req, Pdelay_Resp, and Pdelay_Resp_Follow_Up messages are used to measure the link
delay between two clock ports implementing the “peer delay mechanism”. It will be detailed in $ 2.1.2.
PTP V2 split “timing information”, and “master-slave hierarchy” determination. In fact in V1, best master
selection information was sent in a Sync message, which length was 124 bytes. On the contrary in V2,
this is sent separately in an Announce message. It enables a much smaller Sync message (44 bytes),
with higher Sync message rates using less bandwidth. Sync and Announce messages are sent
periodically by the Master but Sync messages with a much more frequent rate. To give an idea, in the
profile defined by 802.1 AS, the interval between two Announce messages is 1s, and the one between
two Sync messages is nearly 8ms.
2.1.1.1. Management messages
The management messages are used to query and update the PTP data sets maintained by clocks.
These messages are also used to customize a PTP system, to generate certain events and for
initialization and fault management. The format of this kind of message is given below.
Management 1588 V2
Bits
7 6 5 4 3 2 1 0
Octets Offset
Header 34 0
targetPortIdentity 10 34
startingBoundaryHops 1 44
boundaryHops 1 45
reserved actionField 1 46
reserved 1 47
managementTLV M 48
- 1
- 2
前往页