In this section
This section describes how to apply a filter to optimize the accuracy according to the network in use.
In addition to the IEEE 1588-2008 PTP protocol itself, an additional filter can be applied to reduce the synchronization error imposed by network delay variations. This filter is specified using the PtpFilter parameter. How to handle network delay variations is not covered by the IEEE 1588-2008 specification.
Devices might communicate over an unsynchronized network which can include hubs, switches, bridges and routers without IEEE 1588 synchronization. These devices introduce jitter in the propagation delay of the synchronization messages, which directly affect the synchronization accuracy. However, the synchronization can maintain stability by means of a control loop theory. Nevertheless, it is possible to have a short-term offset error between the slave and the master related to fluctuating propagation delays due to network traffic and device jitter. Hubs typically insert errors in the size of tens of nanoseconds, switches insert errors in the size of up to hundreds of microseconds, and routers might insert errors up to hundreds of milliseconds.
Two filters are implemented: a PDV (packet delay variation) filter and a minimum filter.
The PDV filter is specifically targeting the telecommunications industry where setting a maximum offset error is essential. It works by collecting a number of synchronization messages and delay request messages to use for estimation of the clock offset (see PDV filter). This filter can also be used in other networks if appropriate results can be received.
The minimum filter is a more general filter algorithm, which is generally good for filtering measured offset outliers. It can have some negative effects in networks with large wander (see Minimum filter).
In principle no filtering is needed if the Napatech SmartNICs are deployed in a fully PTP-synchronized network, meaning that all used switches, routers and hubs are PTP-aware and configured as PTP transparent clocks. However, using a minimum filter even in those environments might be desirable to eliminate any effects imposed by sudden delay outliers.
The PtpPDVFilterPeriod parameter specifies the filter time period in seconds in which the clock runs linearly without adjusting the clock drift or the absolute time. In this period the filter collects measurements. At the end of the period the filter estimates the offset based on the collected measurements. At least 3 synchronization messages are required for offset estimation. The default synchronization message frequency is 1/s.
The PtpPDVFilterOffsetAccuracy parameter specifies an offset threshold in nanoseconds. When the filter starts up, a calibration is performed when the filter first estimates an offset below this threshold. After start-up the offset estimates from each filter time period are compared to the specified offset threshold. If an estimate is above the threshold, the filter time period is extended with up to 180% in steps of 10% as shown in the figure below. If the filter still estimates an offset above the threshold, the filter goes back to calibration mode.
The specified offset threshold can also cause measurements to be discarded as shown in the figure above, since measurement points that are outside a regression line plus the specified threshold are removed, and a new regression line is calculated based on fewer points, resulting in a poorer estimation.
For these reasons it is recommended that the PtpPDVFilterOffsetAccuracy parameter is set to a value of twice the expected worst-case error in the given environment.
Selecting a short filter time period can result in poor estimation of the offset and thus poor synchronization accuracy, because the filter has fewer measurement samples to work with and thereby possibly no measurements that are good enough.
The estimation is based on the assumption that the offset function is a linear function. The linearity of the function depends on the linearity of the master and the slave clock. If the master linearity is high because the master is a GPS grandmaster clock or another stratum 1 clock, the offset linearity mainly depends on the slave clock. This accuracy mostly depends on the influence of the environmental temperature on the clock quartz frequency. So unless this frequency is very stable, selecting a long filter time period can also result in poor synchronization accuracy.
This figure shows the trade-off between the number of measurements in the filter time period and the quartz stability.
The PtpMinFilterLen parameter specifies the filter length in number of samples for a minimum filter. The filter length must be adjusted to the network behavior. If there is a high network load and a lot of unsynchronized network components between the synchronized nodes, the filter length must be large. For a switched network, a filter length of 6 to 12 measurement samples and a synchronization rate of 16 to 64 synchronization messages per seconds (in both directions) are recommended.
It is recommended that the filter length is at least twice the number of synchronization messages per second divided by the number of delay request messages per second. Best results are achieved with equal message rates that is a quotient equal to 1. Example: For a master SmartNIC with PTP Default profile and end-to-end PTP delay mechanism it is recommended that PtpSynInterval and PtpDelrMinInterval (see Configuring the PTP Clock) are set to the same value, and that the filter length is at least 2 samples.
If the synchronization stability is not as desired, the filter length must be increased.
If, for instance, you have a PTP synchronization rate of 2 synchronizations per second, the PtpMinFilterLen parameter must be at least 4. Since filtering is done on both synchronization messages and delay request messages, it is also important to note that the best results are achieved by setting the same rate on both the synchronization messages and the delay request messages. In this example, set the delay request message rate to 2 per second.
Setting up the minimum filter is a trade-off between improving the accuracy in disturbed networks and slowing down the synchronization reaction time. To compensate for a slower reaction you can increase the message rates, that is shorten the message intervals.
The PtpMinFilterLen parameter reduces the number of clock adjustments with a factor equal to its value. For instance, if the PtpMinFilterLen parameter is set to 4 and the synchronization rate is set to 2 per second, the resulting actual clock adjustment rate is 1 per 2 seconds.
ntservice.ini code line
The syntax for the ntservice.ini code line applying a synchronization filter is:
'PtpFilter' '=' ( 'None' | 'Minimum' | 'PDV' ) 'PtpMinFilterLen' '=' ( '0' | '1' | '2' | ... | '0xFFFFFFFF' ) 'PtpPDVFilterPeriod' '=' ( '1' | '2' | '3' | ... | '10000' ) 'PtpPDVFilterOffsetAccuracy' '=' ( '1' | '2' | '3' | ... | '1000000' )
This table shows the default values.