[comp.sys.sun] rdate

gilley@ndl.com (Greg Gilley) (06/27/89)

Does anyone have the protocol for Sun's rdate and the corresponding
daemon?  I need to bring up rdate on an SGI box.  Any help and or
source would be greatly appreciated.
					Thanks.

  --------------------------
  |Greg Gilley             |
  |gilley@ndl.COM          |
  |Numerical Design Limited|
  |919-929-2917 (voice)    |
  --------------------------
 

chuck@trantor.harris-atd.com (Chuck Musciano) (07/05/89)

> Does anyone have the protocol for Sun's rdate and the corresponding
> daemon?

I am sure other more enlightened readers will provide more detailed
information, but I discovered that rdate uses the most trivial of
"protocols".  Simply open a socket to the desired host on port 37.  The
host will send back four bytes, in network byte order, which contain the
time, in seconds, since 1 Jan 1900.  If you subtract (unsigned) 2208988800
from this, you'll get Unix time (from 1 Jan 1970).

This service on port 37 seems to be a fundmanetal service of inetd on most
any Unix machine.  I used this to implement rdate for our MIPS machines.

Chuck Musciano				ARPA  : chuck@trantor.harris-atd.com
Harris Corporation 			Usenet: ...!uunet!x102a!trantor!chuck
PO Box 37, MS 3A/1912			AT&T  : (407) 727-6131
Melbourne, FL 32902			FAX   : (407) 727-{5118,5227,4004}

Oh yeah, laugh now!  But when the millions start pouring in, I'll be the one
at Burger King, sucking down Whoppers at my own private table! --Al Bundy

guy@uunet.uu.net (Guy Harris) (07/25/89)

>I am sure other more enlightened readers will provide more detailed
>information,

Yup, "rdate" uses the "Time Protocol" described in the Internet RFC868. 

>This service on port 37 seems to be a fundmanetal service of inetd on most
>any Unix machine.  I used this to implement rdate for our MIPS machines.

Or, at least, "inetd" on any UNIX machine that uses a 4.3BSD-flavored
"inetd" (which includes SunOS 4.x).  Some of the trivial Internet
protocols are implemented inside "inetd", namely (quoting from the
INETD(8C) manual):

     Postel, Jon, ``Echo Protocol,'' RFC 862, Network Information
     Center, SRI International, Menlo Park, Calif., May 1983.

     Postel, Jon, ``Discard Protocol,'' RFC 863, Network Informa-
     tion  Center,  SRI  International,  Menlo  Park, Calif., May
     1983.

     Postel, Jon, ``Character Generater Protocol,'' RFC 864, Net-
     work  Information  Center,  SRI  International,  Menlo Park,
     Calif., May 1983.

     Postel, Jon, ``Daytime Protocol,'' RFC 867, Network Informa-
     tion  Center,  SRI  International,  Menlo  Park, Calif., May
     1983.

     Postel, Jon, and Ken  Harrenstien,  ``Time  Protocol,''  RFC
     868,  Network  Information  Center, SRI International, Menlo
     Park, Calif., May 1983.