Getting gpsd address for ntpd

It seems that the loopback ip-address range 127.127.0.0/16 is used by NTPD to represent drivers for specific clocks. The third octet is the number of the specific driver as found on the list of drivers here and should probably correspond to either your actual clock or to how you want to interact with gpsd.

The fourth octet is the "unit number", which was originally meant to be used in case there were multiple devices on a system supported by the same driver, although in some cases it gets used differently.

As far as I can tell no driver actually connects over TCP/IP to that loopback address, it appears a NTPD quirk to name/represent drivers as loopback ip-addresses.

The pseudo IP-address 127.127.28.0 therefore indicates a specific driver in NTPD, specifically driver 28, the shared memory driver SHM and is one way gpsd and ntpd can interact.

127.127.46.0 denotes a different driver, driver 46, the GPSD NG client driver a specific client driver to interact with gpsd.


All IPv4 addresses in the 127/8 netblock are reserved for host loopback. However, only 127.0.0.1 is commonly used.

RFC 5735, section 3.

127.0.0.0/8 - This block is assigned for use as the Internet host loopback address. A datagram sent by a higher-level protocol to an address anywhere within this block loops back inside the host. This is ordinarily implemented using only 127.0.0.1/32 for loopback. As described in [RFC1122], Section 3.2.1.3, addresses within the entire 127.0.0.0/8 block do not legitimately appear on any network anywhere.

Having different addresses used for different purposes when all addresses end up in the same place is useful:

  • for traffic separation e.g. in firewall rules
  • for any services that do not support virtual hosting

Generally speaking, as long as your system routing tables are set up to allow for 127/8 as loopback, you can use any 127/8 address you want, as long as you are consistent on the server and client sides.

Tags:

Linux

Gps

Ntpd