How NTP works
NTP keeps clocks in sync to within milliseconds. The client records four timestamps (sent, received, replied, arrived) and from them works out both the network delay and its own clock offset.
Layer: Application (OSI layer 7) · Port: 123 · Transport: UDP · Format: 48-byte timestamps · Standard: RFC 5905
NTP packet flow
- NTP Client → NTP Server: Client request t1=12:00:00.000
- NTP NTP Server → Client: Server reply t2=…000.012 t3=…000.013
- NTP Client → Client: Offset = ((t2-t1)+(t3-t4))/2 → adjust clock
Other protocols: Ethernet · IP · IPv6 · TCP · UDP · ICMP · ARP · DHCP · DNS · BGP · IGMP