13

I got a simple task: Setup a ToD server... It is not NTP. It runs on port 37. It seems to be bundled with inetd or xinetd.

Shall be installed on Debian or CentOS. Alternatively FreeBSD (pfsense router).

Any hint on how to proceed? Two starter links where after I got stuck:

Also very much apreciated if if a way to test if the ToD-server is running allready. I have quite a few servers running but are not aware if any of them allready have the ToD-service running

Reason: I am about to setup a solution with broadband over COAX cables using a CMTS and cable modems using a standard called DOCSIS 3. To do so the cable modems needs to receive a time from a ToD-server (Time of day).

UPDATE / Solution

The Time is RFC 868 and hardly used any more since NTP and others are better. But the old RFC 868 Time over port 37 is needed for some systems - e.g. Internet over COAX using CMTS and cable modems need a working time server (in DOCSIS documentation called Time of Day server = ToD server). The xinetd that can be installed for Debian includes a time server. It just has to be enabled in etc/xinetd.d/time (disable=no for TCP and/or UDP)

Tillebeck
  • 511
  • 1
  • 4
  • 19
  • 2
    [See here for a little blurb about ToD servers and the TIME protocol](http://www.nist.gov/pml/div688/grp40/its.cfm). NIST's blurb says: `the time format (as specified in RFC-868) has poor error-handling capabilities in general, and many of the client programs that use this format are poorly written and may not handle network errors properly. Therefore users are strongly encouraged to switch to the Network Time Protocol (NTP), which is more robust and provides greater accuracy. We eventually intend to phase out support for the TIME format on all servers.` – HopelessN00b Jan 02 '15 at 16:02
  • 1
    My older question has some information about this also: http://serverfault.com/questions/156715/openwrt-use-rdate-with-ntp-servers – Stefan Lasiewski Jan 02 '15 at 19:53

3 Answers3

20

If you're using Debian, xinetd comes with a ToD daemon. If you change the "disable = yes" like in /etc/xinetd.d/time to "disable = no" and then restart xinetd, you should be able to telnet to the server on port 37 and check that you get something returned. You can use something like:

nc $IP 37 | hexdump

and you'll see that the hex value increases every second.

Edd
  • 386
  • 2
  • 8
  • Thanks. Great way to test. Done it towards a few public servers. Cannot make time run on my own server yet. But will, eventually. – Tillebeck Jan 03 '15 at 16:40
  • Ok. Got it working now. I only need the UDP of the time. But nc $IP 37 use TCP. So after enabling both it works! Great. Thanks. – Tillebeck Jan 03 '15 at 17:33
10

A "Time of Day" server is a pretty vague term - I'm not clear if that is referring to an an actual service named "ToD", or is just poor documentation. The Time protocol (RFC 868) is so old that very few things use it, except for a small number of embedded firmwares (such as OpenWRT), devices and appliances with little memory. NTP requires more memory than the Time protocol.

Nearly all modern appliances can use the Network Time Protocol (NTP) which has replaced the older Time protocol, which is better and probably more secure than the ancient time protocol. So spend some time now to see if your device uses NTP support.

Believe it or not, the Wikipedia article for xinetd contains a single configuration example, and it's for an RFC 868 time server.

See http://en.wikipedia.org/wiki/Xinetd#Configuration

An example configuration file for the RFC 868 time server:

# default: off
# description: An RFC 868 time server. This protocol provides a
# site-independent, machine readable date and time. The Time service sends back
# to the originating source the time in seconds since midnight on January first
# 1900.
# This is the tcp version.
service time
{
        disable         = yes
        type            = INTERNAL
        id              = time-stream
        socket_type     = stream
        protocol        = tcp
        user            = root
        wait            = no
}

# This is the udp version.
service time
{
        disable         = yes
        type            = INTERNAL
        id              = time-dgram
        socket_type     = dgram
        protocol        = udp
        user            = root
        wait            = yes
}
psmears
  • 330
  • 1
  • 6
Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
  • Thanks. I got stuck since inetd and xinetd are listed as beeing part of the default linux installs. I just setup a fresh debian and there neither of them where installed. After installing xinetd I have the file and can proceed from here. Thanks. – Tillebeck Jan 03 '15 at 16:48
  • 2
    "time of day" or "ToD" is the name that the RFC 868 is called in the DOCSIS documentation. DOCSIS is for CMTS and cable modems when providing internet along with TV over COAX cables. I am glad you all could help me after all. – Tillebeck Jan 03 '15 at 17:45
5

Time.nist.gov supports the old time and daytime protocols. Note that as far as I remember, those protocols presume there are no network issues.

Stefan Lasiewski
  • 22,949
  • 38
  • 129
  • 184
Jim B
  • 23,938
  • 4
  • 35
  • 58
  • Thanks. I used one of the public servers to test against. And I can see they answer with time well. Now I need my own server to do the same – Tillebeck Jan 03 '15 at 16:41