Time Protocol
Internet protocol suite |
---|
Application layer |
Transport layer |
Internet layer |
Link layer |
The Time Protocol is a network protocol in the Internet Protocol Suite defined in 1983 in RFC 868. Its purpose is to provide a site-independent, machine readable date and time.
The Time Protocol may be implemented over the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP). A host connects to a server that supports the Time Protocol on port 37. The server then sends the time as a 32-bit unsigned integer in binary format and in network byte order, representing the number of seconds since 00:00 (midnight) 1 January, 1900 GMT, and closes the connection. Operation over UDP requires the sending of any datagram to the server port, as there is no connection setup for UDP.
Using a fixed 32-bit data format means that the timestamp counter will periodically roll over. This occurs roughly every 136 years, with the first such occurence on 7 February 2036. Programs that use the Time Protocol must have been carefully designed to use context-dependent information to distinguish these dates from those in 1900, or they might report an incorrect date and time when used after this date.
Traditionally many Unix-like operating systems used the Time Protocol to monitor and/or synchronize the clocks of different systems using the rdate utility, but today this functionality has been superseded by the Network Time Protocol (NTP) and the corresponding ntpdate utility, which report times with greater (sub-second) accuracy.
Inetd implementation
On most UNIX-like operating systems a Time Protocol server is built into the inetd (or xinetd) daemon. The service is usually not enabled by default. It may be enabled by adding the following lines to the file /etc/inetd.conf
time stream tcp nowait root internal time dgram udp wait root internal
and reloading the configuration.
See also
- List of well-known ports (computing)
- Echo Protocol
- Discard Protocol
- Daytime Protocol
- Character Generator Protocol
- rdate, a tool for querying the current time from a network server