NSM(8)
π NSM π
okay so bestie, this one's called nsm β short for NetSync Monitor client. it lives in the System Manager's Manual, section 8, and it is genuinely one of those little tools that just works. let me tell you everything, no gatekeeping π«Ά
β¨ SYNOPSIS β¨
nsm [ -f config ] [ -i interface ] [ long-options ] [ command ] ...
that's the whole vibe check right there. you can pass a config file, pick an interface, throw some long options at it, and then give it a command or a few. periodt. π
πΈ DESCRIPTION πΈ
so nsm is a program that implements a NetSync Monitor (NSM) client. NSM is an extension to the Precision Time Protocol (PTP), and what it does is let a client measure the offset of its own clock against literally any PTP clock in the network that supports NSM. iconic behavior honestly.
it uses unicast messages β BUT (and this is the slay part) unlike PTP in unicast mode, it does not require the server to keep any state specific to the client. no state, no baggage, no situationship. π
it's particularly useful for monitoring. like, that's its whole thing.
the program reads commands from standard input or from the command line. both. it's flexible like that.
π COMMANDS π
NSM addressβ send a NetSync Monitor request to the specified network address (IPv4 or MAC) and print the measured offset along with the response. this is the main character command fr fr.helpβ display a help message. when in doubt, ask for help, bestie. π§
π OPTIONS π
-fconfig β read configuration from the specified file. by default, no configuration file is read at all. like, none. zero. zilch.-iinterface β specify the network interface.-hβ display a help message.-vβ print the software version and exit. short and sweet. β
π LONG OPTIONS π
okay this is so cool β each and every configuration file option (yes, all of them, scroll down to PROGRAM OPTIONS and PORT OPTIONS) can also show up as a "long" style command line argument. same options, different outfit.
for example, the transportSpecific option can be set using either of these two forms:
--transportSpecific 1 --transportSpecific=1
both valid. both cute. pick your fighter. β¨
and here's the hierarchy, listen up: option values given on the command line override values in the global section of the configuration file β which, in turn, overrides the default values. command line > config file > defaults. it's giving main character energy at every level. π₯
π CONFIGURATION FILE π
the configuration file is divided into sections. here's how it works:
- each section starts with a line containing its name enclosed in brackets, and then the settings follow.
- each setting goes on its own separate line β it has the name of the option and the value, separated by whitespace characters.
- empty lines and lines starting with
#are ignored. (comments! we love a comment. π)
the global section (written as [global]) sets the global program options and the default port specific options. the other sections are port specific sections, and they override the default port options. the name of the section is the name of the configured port β like [eth0] for example.
π¦ PORT OPTIONS π¦
active_key_idβ used in conjunction with thesppandsa_filedirectives to specify which key from thesppdefined Security Association should be used for outbound icv calculations. all Security Associations are read from the file specified bysa_file. requiressppandsa_filedirectives. must be in the range of1to2^32-1, inclusive. the default is0(disabled).delayAsymmetryβ the time difference in nanoseconds of the transmit and receive paths. this value should be positive when the master-to-slave propagation time is longer, and negative when the slave-to-master time is longer. the default is0nanoseconds.network_transportβ select the network transport. possible values areUDPv4andL2. the default isUDPv4.sppβ specifies the Security Parameters Pointer of the desired Security Association to be used for Authentication TLV support for a given port. any port with an assignedsppwill attach Authentication TLVs to all outbound messages and check for Authentication TLVs on all inbound messages, in accordance to the corresponding security association sourced via thesa_filedirective. outbound Authentication TLVs are generated using the key specified byactive_key_id. not compatible with one step ports or advertised versions less than PTPv2.1. requiressa_fileandactive_key_iddirectives. must be in the range of0to255, inclusive. the default is-1(disabled).transportSpecificβ the transport specific field. must be in the range0to255. the default is0.
π PROGRAM OPTIONS π
domainNumberβ the domain attribute of the local clock. the default is0.sa_fileβ specifies the location of the file containing Security Associations used for immediate security processing of the Authentication TLV, in support of the optional security mechanism defined inieee1588-2019 ch 14.16. see SECURITY ASSOCIATION OPTIONS for info on how this file should be formatted.sppandactive_key_idshould be specified for each port to indicate which Security Association from the/fBsa_file/fRshould be used. the default is an empty string.time_stampingβ the time stamping method. the allowed values arehardware,softwareandlegacy. the default ishardware.
π WARNING π
bestie. listen. be cautious when the same configuration file is used for both ptp4l and nsm. keep in mind that values specified in the configuration file take precedence over their default values. so if a certain option that's common to both ptp4l and nsm is specified to a non-default value in the configuration file (like, for ptp4l), then that non-default value applies to nsm too. and that might not be what you expected. π
to avoid securely these unexpected behaviour, different configuration files for ptp4l and nsm are recommended. (yes that sentence is worded exactly like that, and no i will not be fixing it, it's iconic in its own way π«Ά)
π SEE ALSO π
and that's the whole page, bestie! this manual page is from linuxptp, dated March 2024, and it's the NSM(8) page from the System Manager's Manual. go measure some offsets. slay. π
π¦ where this page comes from
- arch rolling: linuxptp 4.4-2 Β· GPL-2.0-or-later
- centos-stream 10: linuxptp 4.4-9.el10 Β· GPL-2.0-or-later
- centos-stream 9: linuxptp 4.4-6.el9 Β· GPL-2.0-or-later
- fedora 43: linuxptp 4.4-7.fc43 Β· GPL-2.0-or-later
- fedora 44: linuxptp 4.4-10.fc44 Β· GPL-2.0-or-later
- nixpkgs unstable: linuxptp 4.4
- opensuse-leap 16.0: linuxptp 4.4-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: linuxptp 4.4-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: linuxptp 4.4-160000.3.1 Β· GPL-2.0-or-later
- opensuse-leap 16.0: linuxptp 4.4-160000.3.1 Β· GPL-2.0-or-later
- ubuntu resolute: linuxptp 4.4-0ubuntu1 Β· GPL-2.0-or-later
- ubuntu stonking: linuxptp 4.4-0ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms