CLOCKDIFF(8)
π CLOCKDIFF(8) π
okay bestie, gather round, we're doing the clockdiff page from iputils and it's lowkey iconic. this is section 8, so it's a sysadmin situation, and it's literally about figuring out how far apart two clocks are. clock girl summer fr fr πβ¨
β¨ NAME β¨
clockdiff β measure clock difference between hosts π«Ά
πΈ SYNOPSIS πΈ
clockdiff [-o] [-o1] [--time-format ctime iso] [-V] {destination}
π¦ DESCRIPTION π¦
So the whole vibe of clockdiff is: it measures the clock difference between us and destination, with 1 msec resolution. how does it do that? it uses ICMP TIMESTAMP packets [2] or, optionally, the IP TIMESTAMP option [3] added to an ICMP ECHO. [1] it's giving "detective but make it packets". no cap π
π OPTIONS π
-oβ uses IP TIMESTAMP with ICMP ECHO instead of ICMP TIMESTAMP messages. this one is useful with certain destinations that do NOT support ICMP TIMESTAMP (f.e. Solaris <2.4). some hosts are just built different, and not in a good way π-o1β slightly different form of-o, namely it uses three-term IP TIMESTAMP with prespecified hop addresses instead of the four-term one. which flavor works better depends on the target host. particularly,-ois better for Linux. β¨-T,--time-format ctime isoβ prints the time stamp in the output either in ISO-8601 format or in classic ctime format. the ctime format is the default. the ISO time stamp includes the timezone, and it's easier to parse. periodt π-Iβ alias of the--time-format isooption and argument. cute shortcut energy π-h,--helpβ prints help and exits. queen behavior π-V,--versionβ prints version and exits. π«
π WARNINGS π
- Some nodes (Cisco) use non-standard timestamps, which is allowed by RFC, but makes timestamps mostly useless. π
- Some nodes generate messed timestamps (Solaris>2.4), when run
xntpd. Seems its IP stack uses a corrupted clock source, which is synchronized to time-of-day clock periodically and jumps randomly, making timestamps mostly useless. good news is that you can use NTP in this case, which is even better. π clockdiffshows difference in time modulo 24 days. yeah. 24 days. do with that what you will bestie π
ngl the Cisco one and the Solaris one are giving "we tried our best and our best was not enough". but hey, NTP ate and left no crumbs.
π SEE ALSO π
ping(8), arping(8), tracepath(8).
π REFERENCES π
[1] ICMP ECHO, RFC0792, page 14.
[2] ICMP TIMESTAMP, RFC0792, page 16.
[3] IP TIMESTAMP option, RFC0791, 3.1, page 16.
π§ AUTHOR π§
clockdiff was compiled by Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>. It was based on code borrowed from the BSD timed daemon. the way this was literally built on borrowed code and still slayed β respect π«‘
π₯ SECURITY π₯
clockdiff requires CAP_NET_RAW and CAP_SYS_NICE capabilities to be executed. It is safe to be used as set-uid root. yes bestie, set-uid root and it's SAFE, we love a responsible icon π
π AVAILABILITY π
clockdiff is part of the iputils package. π«
aaaand that's the whole page, you ate that fr fr π
β¨ this is iputils version 20250605, dating all the way back to 20250605, so go forth and measure some clocks, bestie π°οΈπ¦π
π¦ where this page comes from
- alpine 3.24: iputils-doc 20250605-r2 Β· BSD-3-Clause AND GPL-2.0-or-later
- arch rolling: iputils 20250605-1 Β· BSD-3-Clause AND GPL-2.0-or-later
- fedora 43: iputils 20250605-1.fc43 Β· BSD-4-Clause-UC AND GPL-2.0-or-later
- fedora 44: iputils 20250605-2.fc44 Β· BSD-4-Clause-UC AND GPL-2.0-or-later
- nixpkgs unstable: iputils 20250605
- ubuntu resolute: iputils-clockdiff 3:20250605-1ubuntu1 Β· BSD-3-Clause
- ubuntu stonking: iputils-clockdiff 3:20250605-1ubuntu1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms