• Nenhum resultado encontrado

Chapter 1 Introduction

3.6 Window-based Processing

The goal going forward is to combine multiple measurementsx[n]˜ from (3.4) or times- tamp differences from (3.3) to obtain less noisy time offsetestimates. Generally speaking, the ideal estimator would be a minimum variance unbiased (MVU) estimator [121]. If the Cram´er- Rao lower bound (CRLB) could be formulated, that would be the ultimate goal. However, it is unreasonable to pursue a generic MVU estimator based on the CRLB because time and frequency offset measurement noises depend on network-specific delay distributions. This in- ability to formulate probability distributions for the observations prevents the CRLB derivation and the closed-form derivation of other popular estimators such as the maximum likelihood es- timator (MLE). Thus, the algorithms discussed in this section follow intuition about the delay statistics more than rigorous mathematical derivation.

More specifically, this section discusses methods based on observation windows. Each window comprisesN observations and results in a single estimate. The goal is to extract more information from the collection of samples and alleviate the noise effects.

The observation windows can be non-overlapping and overlapping, as illustrated in Fig. 3.2.

With overlapping windows, each window hasN−1samples in common with its preceding win- dow. In this case, for each new input sample, there is a new observation window, aside from the initial transitory. For example, in Fig. 3.2, which illustrates the case ofN = 4, when sample x[4]comes, the observation window slides to the right and encompasses x[1]to x[4]. When x[5]comes, the window covers x[2] to x[5], and so on. In this case, because there is a new estimate for each window, the estimator’s output rate is the same as its input rate despite the window-based approach. In the context of synchronization, this method implies that the slave does not need to wait long to re-synchronize its clock.

Nevertheless, to simplify the notation, non-overlapping windows are considered in the sequel. With non-overlapping windows, thek-th window holds indexes[kN,(k+ 1)N). Also, as mentioned in Section 3.1, the non-windowed indexn matches with kN +m in windowed notation, wherekdenotes the window index andmdenotes the sample position in the window.

The non-windowed and windowed indexing schemes are highlighted in Fig. 3.2.

Some of the estimators discussed in this section are referred to aspacket selectionin the literature [43–46, 123]. This denomination stands from the fact that these algorithms select a pair of PTP messages in each observation window, one message in the m-to-s direction, the other in the s-to-m direction. Then, for each window, these algorithms estimate the time offset

x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7]

x[0] x[1] x[2] x[3] x[4] x[5] x[6] x[7]

Window 0

Window 0 Window 1

Window 1 Window 2

Window 3 Window 4 Non-overlapping Windows:

Overlapping Windows:

x[0,0] x[0,1] x[0,2] x[0,3] x[1,0] x[1,1] x[1,2] x[1,3]

Non-windowed Indexing Windowed Indexing x[n]

x[k,m]

Figure 3.2:Non-overlapping and overlapping observation windows.

using only the selected message pair.

Furthermore, this section discusses strategies such assample-averageandsample-mode, which are more generally referred to aspacket filtering. Unlike packet selection, these strategies consider the timestamps from all messages in each window. As clarified next, its common aspect with packet selection is that both types of processing assume that the time-offset remains constant throughout each observation window.

The referred estimators generally processes the timestamps differences t21[n]and t43[n]

from (3.3). In thek-th observation window, they process the vectors:

t21[k] = [t21[k,0], t21[k,1],· · ·, t21[k, N−1]]T (3.17) t43[k] = [t43[k,0], t43[k,1],· · ·, t43[k, N−1]]T , (3.18) each containingN timestamp differences.

As discussed in [124], the final estimate is obtained by:

ˆ

x[k] = ξ{t21[k]} −ξ{t43[k]}

2 , (3.19)

whereξ{}denotes an arbitrary operator, typically the minimum, maximum, mean, median, or mode1 operator. The minimum and maximum operators lead to the packet selection approach.

Using (3.3), note that, if the time offsetx[kN +m]is constant over thek-th observation

1The mode operator is typically preceded by the quantization of t21[n]andt43[n]and succeeded by the de- quantization of the operator’s results.

window (for0≤m < N), it can be factored out of the operator, so that (3.19) becomes:

ˆ

x[k]≈x[kN] + ξ{dms[k]} −ξ{dsm[k]}

2 , (3.20)

where x[kN] denotes the time offset of the k-th window, constant within the index range [kN ,(k+ 1)N), whiledms[k]anddsm[k]are vectors given by:

dms[k] = [dms[k,0],· · · , dms[k, N−1]]T (3.21) dsm[k] = [dsm[k,0],· · · , dsm[k, N−1]].T (3.22) From (3.20), note the goal is to maximize the chances of having ξ{dms[k]} equal to ξ{dsm[k]} withinN measurements, such that these terms can cancel each other. The success depends not only on the statistic pursued by the operator being symmetric (condition 1) but also on the chances of finding such symmetric realizations withinN measurements (condition 2).

For instance, when PTP shares the network with BG traffic, some PTP messages may still be lucky enough to traverse the entire network without colliding with BG packets, i.e., with no queuing delay. In this case, if all asymmetry sources from Table 3.1 other than queuing delay are absent, it is theoretically possible that the minimumt21[n]andt43[n]inN realizations becomes symmetric. Furthermore, if the delay distributions are more concentrated around their minima, the referred lucky realizations are more likely withinN samples, as discussed in [43].

Due to its probabilistic nature, the algorithm’s performance depends strongly on the win- dow length. By increasingN, the chances of finding symmetric realizations can increase. On the other hand, note that (3.20) assumes that the time offset remains constant throughout each window. This requirement is vital for the method, and it effectively limits the window length.

That is,N must be low enough such thatx[n]remains reasonably constant overN samples.

The time offset can only be constant over an observation window if the slave’s RTC is perfectly syntonized (see Section 2.1.1). In a PTP-unaware network, when the syntonization is handled based on PTP estimates such as (3.12), instead of a PHY frequency reference, the syntonization error is often significant. It comes both from estimation errors and the estimator’s responsiveness to frequency deviations. Ultimately, given that these errors degrade the window- based algorithm’s performance, the window lengthN must be short enough such that the time offset remains reasonably constantafterall syntonization layers.

As discussed in Section 2.1.2, an RTC can be syntonized in hardware, and the residual errors can be corrected in software. This work assumes that the software layer is necessary because the hardware can offer limited correction resolution (discussed in Chapter 4). In this

case, it is useful to precede the computation of (3.19) with a time offset drift compensation step.

More specifically, the proposal is to process the adjusted values oft21[n]andt43[n], given by:









t021[k, m] =t21[k, m]− Pm

j=0

∆ˆx[j]

t043[k, m] =t43[k, m] +

m

P

j=0

∆ˆx[j],

(3.23)

where∆ˆx[n] represents an estimate of the time offset drift∆x[n] = x[n]−x[n −1], whose discussion is postponed to Section 3.9. Besides, note this adjustment is analogous to the SW- based syntonization discussed in Section 2.1.2.

The resulting drift-compensated timestamp differences from (3.23) can be organized into vectorst021[k]and t043[k], as in (3.17) and (3.18). Then, similarly to (3.19), these vectors are used to estimate the time offset as follows:

ˆ

x[k] = ξ{t021[k]} −ξ{t043[k]}

2 +

N1

X

j=0

∆ˆx[j]. (3.24)

where the summation term reintroduces the drift subtracted from the timestamp difference sam- ples, such thatx[k]ˆ estimates the time offset by the end of the observation window.

The advantage of the estimator implemented by (3.24) is that it tolerates time-varying time and frequency offsets over the observation window. In this case, the window length is limited by the accuracy of the drift estimates∆ˆx[n], which tends to be a more relaxed constraint than the requirement of a constant time offset throughout the observation windows. As a result, this approach tends to perform well with long observation windows, as discussed in Chapter 6. To the best of our knowledge, this formulation has not been discussed previously in the literature.