05 Zeitsynchronisation
Peripheriegeräte im Netzwerkbetrieb
Die Bedeutung der Zeitmessung
Zeit ist eine fundamentale physikalische Größe, die in vielen Bereichen der Wissenschaft und Technik eine zentrale Rolle spielt. Seit dem 17. Jahrhundert wird die Zeitmessung auf Basis des mittleren Sonnentags durchgeführt, der als Durchschnitt der Sonnentage gemessen vom Sonnenhöchststand bis zum nächsten Sonnenhöchststand definiert ist und 24 Stunden beträgt. Dies entspricht 86.400 Sekunden pro Tag.:contentReference[oaicite:8]{index=8}
- contentReference[oaicite:9]{index=9} :contentReference[oaicite:10]{index=10} :contentReference[oaicite:11]{index=11} :contentReference[oaicite:12]{index=12}:contentReference[oaicite:13]{index=13}
Schaltsekunden
- contentReference[oaicite:14]{index=14} :contentReference[oaicite:15]{index=15} :contentReference[oaicite:16]{index=16} :contentReference[oaicite:17]{index=17} :contentReference[oaicite:18]{index=18}:contentReference[oaicite:19]{index=19}
- contentReference[oaicite:20]{index=20} :contentReference[oaicite:21]{index=21} :contentReference[oaicite:22]{index=22} :contentReference[oaicite:23]{index=23}:contentReference[oaicite:24]{index=24}
Network Time Protocol (NTP)
- contentReference[oaicite:25]{index=25} :contentReference[oaicite:26]{index=26} :contentReference[oaicite:27]{index=27} :contentReference[oaicite:28]{index=28}:contentReference[oaicite:29]{index=29}
Externe Zeitgeber
DCF77
- **Standort:** :contentReference[oaicite:30]{index=30}:contentReference[oaicite:31]{index=31}
- **Frequenz:** :contentReference[oaicite:32]{index=32}:contentReference[oaicite:33]{index=33}
- **Betreiber:** :contentReference[oaicite:34]{index=34}:contentReference[oaicite:35]{index=35}
- **Genauigkeit:** :contentReference[oaicite:36]{index=36}:contentReference[oaicite:37]{index=37}
- contentReference[oaicite:38]{index=38} :contentReference[oaicite:39]{index=39}:contentReference[oaicite:40]{index=40}
TDF
- **Standort:** :contentReference[oaicite:41]{index=41}:contentReference[oaicite:42]{index=42}
- **Frequenz:** :contentReference[oaicite:43]{index=43}:contentReference[oaicite:44]{index=44}
- **Betreiber:** :contentReference[oaicite:45]{index=45}:contentReference[oaicite:46]{index=46}
- **Abdeckung:** :contentReference[oaicite:47]{index=47}:contentReference[oaicite:48]{index=48}
- contentReference[oaicite:49]{index=49} :contentReference[oaicite:50]{index=50}:contentReference[oaicite:51]{index=51}
GPS
- **Global verfügbar**
- **Zivile Nutzung abhängig von politischen Umständen**
- **Europäisches Galileo-System als zukünftige Alternative geplant**
- contentReference[oaicite:52]{index=52} :contentReference[oaicite:53]{index=53}:contentReference[oaicite:54]{index=54}
Funktionsweise von NTP
NTP kommuniziert über den User Datagram Protocol (UDP) Port 123 und ermöglicht es Clients, die Zeit von externen Quellen wie Funkuhren oder Internet-Zeitservern abzufragen. Der Synchronisationsprozess beinhaltet mehrere Schritte, bei denen der Client Zeitstempel sendet und empfängt, um die lokale Uhrzeit präzise anzupassen. Dabei werden Algorithmen verwendet, um Verzögerungen im Netzwerk zu kompensieren und die Genauigkeit der Zeitangaben zu erhöhen.
- contentReference[oaicite:55]{index=55}
Konfiguration auf einem Raspberry Pi
Installation von NTP
sudo apt-get install ntp
Zeitserver eintragen (z. B. für die Schweiz)
sudo nano /etc/ntp.conf # oder sudo nano /etc/ntpsec/ntp.conf server 0.ch.pool.ntp.org iburst server 1.ch.pool.ntp.org iburst server 2.ch.pool.ntp.org iburst server 3.ch.pool.ntp.org iburst server ntp.metas.ch iburst
Dienst starten/stoppen
sudo systemctl stop ntp sudo systemctl start ntp
Abfrage der Synchronisation
ntpq -p
Ausgabe von ntpq -p
Bedeutungen
- `remote`: Zeitserver
- `refid`: Quelle des Servers
- `st`: Stratum-Level
- `t`: Typ (u = unicast, l = local, m = multicast)
- `when`: Zeit seit letzter Antwort
- `poll`: Abfrageintervall
- `reach`: Erreichbarkeit (377 = 8/8 erfolgreich)
- `delay`: Antwortzeit in ms
- `offset`: Zeitdifferenz in ms
- `jitter`: Schwankung in ms
Markierungen
- `*`: Aktuelle Zeitquelle
- `+`: Im Mittelwert enthalten
- `x`: Ungültige Quelle
- `#`: Quelle außerhalb der Distanz
- `o`: Pulse-per-Second
- `-`: Ausgeschlossen durch Algorithmus
- `.`: Letzter Kandidat