NTP Server mit Linux

Aus Port23Wiki
Wechseln zu: Navigation, Suche

Aufbau eines NTP Servers mit Linux mit DCF-77 und GPS als Zeitquellen

Inhaltsverzeichnis

Linux Version

cat /etc/devuan_version 
daedalus


[    0.000000] Linux version 6.1.0-17-amd64 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debia

n) 2.40) #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30)

[    0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-6.1.0-17-amd64 root=UUID=eb0e22d6-bf4c-46bf-b7dd-bc4a0a9ef1fc ro quiet
[    0.000000] BIOS-provided physical RAM map:

[    0.000000] efi: EFI v2.31 by American Megatrends
[    0.000000] efi: ACPI=0xac532000 ACPI 2.0=0xac532000 SMBIOS=0xae1e9a98 MOKvar=0xad793000 
[    0.000000] secureboot: Secure boot disabled
[    0.000000] SMBIOS 2.8 present.
[    0.000000] DMI: FUJITSU FUTRO S920/D3313-A1, BIOS V4.6.5.4 R1.18.0 for D3313-A1x 07/10/2018
[    0.000000] tsc: Fast TSC calibration using PIT
[    0.000000] tsc: Detected 1497.160 MHz processor
[    0.309340] smpboot: CPU0: AMD GX-415GA SOC with Radeon(tm) HD Graphics (family: 0x16, model: 0x0, stepping: 0x1)

DCF-77 Empfänger

[  373.128888] usb 5-1: new full-speed USB device number 5 using ohci-pci
[  373.337304] usb 5-1: New USB device found, idVendor=0403, idProduct=e88a, bcdDevice= 6.00
[  373.337333] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  373.337343] usb 5-1: Product: Expert mouseCLOCK USB II
[  373.337351] usb 5-1: Manufacturer: GUDEADS
[  373.337359] usb 5-1: SerialNumber: XXX
[  373.344527] ftdi_sio 5-1:1.0: FTDI USB Serial Device converter detected
[  373.344720] usb 5-1: Detected FT232R
[  373.351128] usb 5-1: FTDI USB Serial Device converter now attached to ttyUSB0

GPS Empfänger

[  320.052888] usb 5-4: new full-speed USB device number 4 using ohci-pci
[  320.247155] usb 5-4: New USB device found, idVendor=1546, idProduct=01a7, bcdDevice= 1.00
[  320.247183] usb 5-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  320.247194] usb 5-4: Product: u-blox 7 - GPS/GNSS Receiver
[  320.247202] usb 5-4: Manufacturer: u-blox AG - www.u-blox.com
[  320.251377] cdc_acm 5-4:1.0: ttyACM1: USB ACM device

Konfiguration DCF-77 Empfänger

/etc/ntpsec/ntp.conf

server 127.127.8.0 mode 19 # 
server 127.127.8.0-3 mode 19
   Gude Analog- und Digitalsystem GmbH ‘Expert mouseCLOCK USB v2.0’
root@ntpsrv:~# ls -l /dev/refclock-0 
lrwxrwxrwx 1 root root 12 19. Feb 18:57 /dev/refclock-0 -> /dev/ttyUSB0

Konfiguration GPS Empfänger

cat /etc/default/gpsd 
# Start the gpsd daemon automatically at boot time
START_DAEMON="true"

# Devices gpsd should collect to at boot time.
# They need to be read/writeable, either by user gpsd or the group dialout.
DEVICES="/dev/ttyACM1"

# Other options you want to pass to gpsd
GPSD_OPTIONS="-n"

# Automatically hot add/remove USB GPS devices via gpsdctl
USBAUTO="true"
/etc/ntp/ntpsec.conf

# gps SHM from gpsd
server 127.127.28.0 

Doku

Offset für GPS unt DCF-77 noch NICHT eingestellt:

root@ntpsrv:~# ntpq -p
    remote                                   refid      st t when poll reach   delay   offset   jitter
=======================================================================================================
+ntp.netnod.se                           .PPS.            1 u   57   64   37  34.5104  13.1120   1.5906
+any.time.nl                             85.199.214.102   2 u   66   64   76  15.8433  12.8707   1.4686
RAWDCF_MOUSECLOCK(0)                    .DCFa.            0 l    7   64   17   0.0000   8.4088   2.2834
SHM(0)                                  .SHM.             0 l    7   64   77   0.0000 -46.5409   2.0497


Zeitdrift ohne NTP Synchronisierung

Linux / AMD FX8350

Hardware:

[    0.133796] smpboot: CPU0: AMD FX(tm)-8350 Eight-Core Processor (family: 0x15, model: 0x2, stepping: 0x0)
Mainboard:  Product Name: 990FXA-UD3
[    0.000000] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1910969940391419 ns
[    0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484873504 ns
[    0.000002] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x39ebec5d7e4, max_idle_ns: 440795251285 ns
[    0.153208] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 1911260446275000 ns
[    0.185220] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI EDR HPX-Type3]
[    0.191163] PTP clock support registered
[    0.200080] clocksource: Switched to clocksource tsc-early
[    0.212174] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    1.071196] rtc_cmos 00:05: setting system clock to 2023-12-09T17:15:40 UTC (1702142140)
[    1.093819] sched_clock: Marking stable (1101005181, -7995516)->(1109656560, -16646895)
[    1.239068] tsc: Refined TSC clocksource calibration: 4018.324 MHz
[    1.239086] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x39ebfa4a18d, max_idle_ns: 440795326093 ns
[    1.239162] clocksource: Switched to clocksource tsc
[    1.319020] clk: Disabling unused clocks
[    0.000000] ACPI: HPET 0x00000000BE1EAD10 000038 (v01 ALASKA A M I    01072009 AMI  00000005)
[    0.000000] ACPI: Reserving HPET table memory at [mem 0xbe1ead10-0xbe1ead47]
[    0.000000] ACPI: HPET id: 0x43538210 base: 0xfed00000
[    0.000000] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484873504 ns
[    0.008000] tsc: using HPET reference calibration
[    0.198066] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0
[    0.198070] hpet0: 3 comparators, 32-bit 14.318180 MHz counter
[    1.071221] rtc_cmos 00:05: alarms up to one month, y3k, 114 bytes nvram, hpet irqs


cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm 

cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
tsc
Linux host 6.6.4-200.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Dec  3 18:13:11 UTC 2023 x86_64 GNU/Linux

Linux / AMD GX4-15GA

Hardware:

[    0.309340] smpboot: CPU0: AMD GX-415GA SOC with Radeon(tm) HD Graphics (family: 0x16, model: 0x0, stepping: 0x1)
Product Name: FUTRO S920
Version: V4.6.5.4 R1.18.0 for D3313-A1x
Product Name: D3313-A1
Version: S26361-D3313-A1 
[    0.037069] clocksource: refined-jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645519600211568 ns
[    0.153972] clocksource: hpet: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 133484873504 ns
[    0.174000] clocksource: tsc-early: mask: 0xffffffffffffffff max_cycles: 0x1594a7e9ed0, max_idle_ns: 440795279371 ns
[    0.323732] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.405946] acpi PNP0A08:00: _OSC: OS supports [ExtendedConfig ASPM ClockPM Segments MSI HPX-Type3]
[    0.418292] PTP clock support registered
[    0.432255] clocksource: Switched to clocksource tsc-early
[    0.447905] clocksource: acpi_pm: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 2085701024 ns
[    1.433433] rtc_cmos 00:06: setting system clock to 2024-02-19T17:48:54 UTC (1708364934)
[    1.486358] sched_clock: Marking stable (1485415235, 621164)->(1492365924, -6329525)
[    1.496671] tsc: Refined TSC clocksource calibration: 1497.191 MHz
[    1.496685] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x1594c522ce2, max_idle_ns: 440795237962 ns
[    1.496726] clocksource: Switched to clocksource tsc
[    0.036825] ACPI: PM-Timer IO Port: 0x808
[    0.154564] ..TIMER: vector=0x30 apic1=0 pin1=2 apic2=-1 pin2=-1
[    0.174017] Calibrating delay loop (skipped), value calculated using timer frequency.. 2994.32 BogoMIPS (lpj=5988640)
[    0.467421] workingset: timestamp_bits=36 max_order=20 bucket_order=0
[    5.429941] sp5100_tco: SP5100/SB800 TCO WatchDog Timer Driver
cat /sys/devices/system/clocksource/clocksource0/available_clocksource
tsc hpet acpi_pm 

cat /sys/devices/system/clocksource/clocksource0/current_clocksource
tsc
Linux host 6.1.0-17-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.69-1 (2023-12-30) x86_64 GNU/Linux

FreeBSD Intel Atom

Meine Werkzeuge