2002-05-12 01:39:37 -04:00
|
|
|
\section{Using Time and Daytime Protocol}\label{sec:ntp}
|
2002-02-12 06:50:54 -05:00
|
|
|
%
|
|
|
|
\begin{description}
|
2002-05-12 01:36:53 -04:00
|
|
|
\item[Used files:] nettime.scm nettime-obsolete.scm
|
|
|
|
\item[Name of the package:] nettime nettime-obsolete
|
2002-02-12 06:50:54 -05:00
|
|
|
\end{description}
|
|
|
|
%
|
2002-04-04 11:53:02 -05:00
|
|
|
|
|
|
|
\subsection{Overview}
|
|
|
|
Most Unix hosts provide a Daytime service which sends the current date
|
|
|
|
and time as a human-readable character string. The daytime service is
|
|
|
|
typically served on port 13 as both TCP and UDP.
|
|
|
|
|
|
|
|
The Time protocol provides a site-independent, machine readable date
|
|
|
|
and time. A ``time'' consists of the number of seconds since midnight on
|
|
|
|
1st January 1900. The Time service is typically served on port 37 as
|
|
|
|
TCP and UDP. The idea is that you can confirm your system's idea of
|
|
|
|
the time by polling several independent sites on the network.
|
|
|
|
|
|
|
|
\subsection{Procedures}
|
|
|
|
|
|
|
|
\begin{defundesc}{net:time}{host tcp/udp}{integer}
|
|
|
|
Asks \semvar{host} about the current time. \semvar{tcp/udp} is
|
|
|
|
either \ex{socket\=type/\ob{}stream} or
|
|
|
|
\ex{socket\=type/\ob{}datagram}, that indicate TCP or UDP
|
|
|
|
connection, respectively (depends on the server).\FIXME{Is it
|
|
|
|
correct, that the tcp/udp argument describes TCP or UDP use via
|
|
|
|
socket-type/stream or socket-type/datagram, resp.?} The number of
|
|
|
|
second since 1970 is returned, since the time protocol returns the
|
|
|
|
number of seconds since 1900, whereas Unix time is since 1970. The
|
|
|
|
difference between both answers is 2208988800.
|
|
|
|
\end{defundesc}
|
|
|
|
|
|
|
|
\begin{defundesc}{net:daytime}{host tcp/udp}{string}
|
|
|
|
Asks \semvar{host} about the current daytime. \semvar{tcp/udp} is
|
|
|
|
the same as in \ex{net:time}, indicating to use TCP or UDP. The
|
|
|
|
host's answer is returned (e.g., ``Thursday, April 4, 2'').
|
|
|
|
\end{defundesc}
|
|
|
|
|
2002-05-12 01:36:53 -04:00
|
|
|
\subsubsection*{Obsolete procedures}
|
|
|
|
|
|
|
|
Names in further versions of \ex{nettime} contained a colon (`\ex{:}')
|
|
|
|
after the prefix `\ex{net-}'. This is now changed to a hyphen
|
|
|
|
('\ex{-}'), accordingly to SUnet's philosophy. If you need the old
|
|
|
|
names, use the \ex{nettime\=obsolete}-package that maps the old names
|
|
|
|
to the new ones.
|
|
|
|
|
2002-04-04 11:53:02 -05:00
|
|
|
\subsection{Related work}
|
|
|
|
\begin{itemize}
|
|
|
|
\item \ex{Time.pm} is a Perl module by Graham Barr
|
|
|
|
\item RFC~868 describes the Time protocol
|
|
|
|
\item RFC~867 describes the Daytime protocol in all its glory
|
|
|
|
\item For a genuinely useful protocol look at the Network Time
|
|
|
|
Protocol defined in RFC~1305, which allows for the synchronization
|
|
|
|
of clocks on networked computers.
|
|
|
|
\end{itemize}
|
|
|
|
%%% Local Variables:
|
|
|
|
%%% mode: latex
|
|
|
|
%%% TeX-master: t
|
|
|
|
%%% End:
|