2
engineering students at Case Western Reserve University over
a period of approximately six months as part of an
undergraduate senior project.
B. Test and Measurement
PTPd is currently developed for Test and Measurement
(T&M) systems. For T&M devices (e.g., volt meters and
thermocouple instruments), PTP provides time and frequency
coordination for the time-stamping of acquired data, and PTP
provides a common time-base for time-triggered data
acquisition.
The needs of T&M systems significantly influence the
current design of PTPd’s clock servo. Most notably, the servo
is optimized for the stable network topology typical of test and
measurement set-ups.
C. Hardware Constraints
PTPd is a software-only system. It lacks two notable
systems found in hardware-supported implementations. First,
PTPd uses software time stamps. It records message send and
receive times in the software layers of the network stack rather
than in the physical layer of the networking hardware (e.g.,
snooping the MII bus of an Ethernet PHY [2]). Second, PTPd
uses a software clock. It adjusts the magnitude of the periodic
increment of a time quantity stored in memory. However,
PTPd was outfitted with a hardware clock for the tests
included in this paper. This was done to allow the clock to be
read with minimal jitter by isolating jitter in clock reads from
jitter in clock coordination.
PTPd is intended for embedded computer platforms that
have minimal computing resources. This includes platforms
with sub-100MHz CPUs. The program’s CPU utilization is
below 1% on a 66 MHz m68k processor, as observed by
standard resource utilization monitors like the UNIX top
utility. Also, PTPd does not require a Floating Point Unit
(FPU), or FPU emulation, because it uses only fixed point
arithmetic. Efficiency and limitation to fixed-point arithmetic
are significant considerations in the design of the clock servo.
D. Software Constraints
PTPd is currently ported to Linux. Most of the PTPd
system, including the protocol stack and the clock servo, runs
as a background user-space process. This allows PTPd to
“play nicely” in typical multi-task computing environments.
PTPd relies on simple kernel-space routines for its timely
components: the frequency adjustable clock and the message
time stamps.
PTPd interfaces with the kernel through standard Linux
system calls. Receive time stamps are recorded in the Network
Interface Card (NIC) driver, in or close to the receive interrupt
handler. The receive time stamps are passed to user-space
though an ioctl(). The receive time stamp mechanism is
included in vanilla (unmodified) Linux version 2.4 and 2.6
kernels. A similar send time stamp mechanism is not included
in vanilla Linux kernels, but kernel send time stamps can be
added to Linux with only small modifications. The entire
modification typically amounts to less than ten lines of code.
PTPd can operate acceptably without kernel send time stamps,
but it performs better with the lower jitter afforded by kernel
send time stamps, especially under heavy CPU loads.
PTPd uses the Linux kernel’s software clock along with
the adjtimex() interface for clock tick-rate adjustment.
Linux’s clock is an implementation of the hybrid kernel
Phase-Locked Loop/Frequency-Locked Loop (PLL/FLL)
designed by David Mills for the Network Time Protocol
(NTP) project [3]. The interface provides many types of clock
adjustments, including a self-tuning PLL servo; however,
PTPd uses its own servo loop and relies on only
adjtimex() frequency adjustment. This combination is
effective because the user-space servo is efficient and is not
sensitive to execution latency, and adjtimex() is accurate
and responsive to rate adjustments.
Vanilla Linux is not a real time operating system (RTOS);
therefore, it guarantees no bounds on interrupt servicing
latencies. Both message receipts and clock ticks are interrupt
driven events. Variations in interrupt latencies create jitter in
the delay estimates that PTPd uses to coordinate clocks. Jitter
presents the greatest challenge to precise time coordination,
and it is the most significant consideration in the design of the
clock servo.
IV. CLOCK SERVO
A. Overview
Figure 1 is a diagram of PTPd’s clock servo. The diagram
from left to right shows the data path from the protocol to the
clock. The protocol regularly samples the master-to-slave
delay (cf. Equation (2.2)), and it intermittently samples the
slave-to-master delay (cf. Equation (2.4)). Correspondingly,
the offset from master is updated regularly, and the one-way
delay is updated intermittently. The figure shows the delay
and Sync interval inputs, the offset and one-way delay
calculations, the offset and one-way delay filters, and the PI
controller that mediates the servo output. The output is a
fractional tick-rate adjustment that disciplines the clock.
Fig. 1. Clock Servo Diagram
B. Design Parameters
Three characteristics were considered during the design
PTPd’s clock servo. First is the closed-loop response,
including convergence and stability. The acceptable period of
initial convergence is on the order of minutes, and the quantity
tracked by the servo changes slowly. This allows convergence
to be attained and maintained with conservative controller
tuning, and conservative tuning largely eliminates stability
concerns.
The second characteristic is time error. This represents the
time-dependent applications that require two clocks to read the
same time at any given point in time. An example of this
requirement would be two systems that must take a
measurement at precisely the same time. Another example
would be two systems that must precisely measure the
coincidence in time of two events. A useful metric of time
coordination is the root-mean-square (RMS) time difference
between clocks.
The third characteristic is rate error. This represents the
time-dependent applications that require two clocks to
progress at the same rate over a given period of time. An
example of this requirement would be a system that measures
the frequency content of a signal. It might seem that low rate
error must follow implicitly from low time error, but this is
not so. A servo design that minimizes time error may sacrifice
rate error, and vice versa. This could occur with an
aggressively tuned servo that tracks closely but with a lot of
ringing, and the converse case could occur in a sluggishly
评论18