NSM(8)

πŸ“¦
version 4.4 Β· 2 versions
, in arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸ’…

  • -f config β€” read configuration from the specified file. by default, no configuration file is read at all. like, none. zero. zilch.
  • -i interface β€” 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 the spp and sa_file directives to specify which key from the spp defined Security Association should be used for outbound icv calculations. all Security Associations are read from the file specified by sa_file. requires spp and sa_file directives. must be in the range of 1 to 2^32-1, inclusive. the default is 0 (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 is 0 nanoseconds.
  • network_transport β€” select the network transport. possible values are UDPv4 and L2. the default is UDPv4.
  • 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 assigned spp will 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 the sa_file directive. outbound Authentication TLVs are generated using the key specified by active_key_id. not compatible with one step ports or advertised versions less than PTPv2.1. requires sa_file and active_key_id directives. must be in the range of 0 to 255, inclusive. the default is -1 (disabled).
  • transportSpecific β€” the transport specific field. must be in the range 0 to 255. the default is 0.

πŸ“ PROGRAM OPTIONS πŸ“

  • domainNumber β€” the domain attribute of the local clock. the default is 0.
  • 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 in ieee1588-2019 ch 14.16. see SECURITY ASSOCIATION OPTIONS for info on how this file should be formatted. spp and active_key_id should be specified for each port to indicate which Security Association from the /fBsa_file/fR should be used. the default is an empty string.
  • time_stamping β€” the time stamping method. the allowed values are hardware, software and legacy. the default is hardware.

πŸ’€ 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. πŸ’œ