RFC 738 UNKNOWN TIME · APPLICATIONS

Time server

A simple protocol for hosts to synchronize their clocks over the network

On rfc-editor.org ↗
PUBLISHED
October 1977
AUTHORS
K. Harrenstien
STREAM
Legacy
SOCKET NUMBER
37 (octal 45)
TIME FORMAT
32-bit unsigned integer
EPOCH
Midnight, 1 January 1900 GMT
YEAR LIMIT
Year 2036
DOI
10.17487/RFC0738

RFC text

Original text · RFC Editor View on rfc-editor.org ↗
NWG/RFC# 738                                         KLH 31 Oct 77 42218
Network Working Group                                     K. Harrenstien
Request for Comments: 738                                         SRI-KL
NIC: 42218                                               31 October 1977



                              Time Server




This note describes the Time Server protocol, as currently implemented
on ITS hosts (i.e. MIT-(AI/ML/MC/DMS)).  The idea is to provide a
site-independent, machine readable date and time in as efficient and
swift a manner as possible; its motivation arises from the fact that not
all systems have a date/time clock, and all are subject to occasional
human or machine error.  The use of time-servers makes it possible to
quickly confirm or correct a system's idea of the time, by making a
brief poll of several independent sites on the network.

In particular the network time server works as follows:

   S: Listen on socket 37 (45 octal).

   U: Connect to socket 37 [not ICP].

   S: Send the time as a 32 bit binary number.

   U: Close the connection.

   S: Close the connection.

Note that this is not a normal ICP sequence.  Rather, instead of sending
a 32-bit socket number to reconnect to, the server returns a 32-bit time
value and closes the connection.  If the server is unable to determine
the time at its site, it should either refuse the connection or close it
without sending anything.

The time is the number of seconds since 0000 (midnight) 1 January 1900
GMT, such that the time 1 is 12:00:01 am on 1 January 1900 GMT; this
base will serve until the year 2036.  As a further example, the most
recent leap year as of this writing began from the time 2,398,291,200
which corresponds to 0000 1 Jan 1976 GMT.

AI ELI5

On this page
PROBLEMNot all ARPANET hosts had accurate clocks, and human or machine errors made time synchronization unreliable. Hosts needed a quick way to check and correct their system time.
MECHANISMA Time Server listens on socket 37 and returns the current time as a 32-bit binary number representing seconds since midnight 1 January 1900 GMT. The server closes the connection after sending the time.
WHY IT MATTERSAny host can poll one or more independent time servers to quickly confirm or correct its notion of the current time.

§1The Need for Network Time

RFC 738 describes a Time Server protocol developed at MIT. The service is straightforward: it lets any host ask several independent time servers for the current time and use those answers to correct its own system clock.

Because not all systems had an onboard clock and because human error in setting time was common, the ARPANET needed a simple, reliable way to distribute authoritative time across the network. The Time Server protocol meets this need with minimal overhead.

Some computers on the network didn't know what time it was. A Time Server lets other computers phone home and ask, "What time is it right now?"

§2How the Protocol Works

A Time Server listens on socket 37 (octal 45). A client connects to that socket; the server does not follow the usual ICP (Initial Connection Protocol) sequence. Instead, immediately upon connection, the server sends a 32-bit binary time value and closes the connection. If the server cannot determine its own time, it refuses the connection or closes without sending data.

This is intentionally simple: no handshakes, no options, no negotiation. A client simply connects, reads the time, and disconnects.

You knock on the door, someone hands you a number that tells you what time it is, and closes the door. That's it.

§3Time Format

The time is encoded as the number of seconds since 0000 (midnight) on 1 January 1900 GMT. This epoch covers the time range until the year 2036 without overflow in a 32-bit unsigned integer. For example, the most recent leap year as of the RFC's writing began at timestamp 2,398,291,200, corresponding to 0000 on 1 January 1976 GMT.

This fixed epoch is unusual by modern standards but was practical for the 1970s. The reference point of 1900 is historical; it was chosen simply as a round date far enough in the past.

The server sends a big number: how many seconds have ticked since midnight on January 1, 1900. It's a simple way to represent any time without worrying about calendars.

§4Practical Use

A host that doubts its clock can poll several independent Time Servers and use the median or mean response to set its system time with high confidence. The protocol's simplicity and statelessness make it resilient: the server never forgets anything, and clients do not need to maintain connection state.

The RFC implies that using multiple servers is important: polling several independent sites on the network makes it possible to quickly confirm or correct a system's idea of the time and spot anomalies when one server gives an outlier.

If you ask a few different people what time it is, you can trust the answer better. You just keep calling until enough servers agree.

§5References