From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,46d2f1cf2698b788 X-Google-Attributes: gidfee84,public From: bortzmeyer@cnam.fr (Stephane Bortzmeyer) Subject: SUMMARY: IP delivers packets only every milli-second? Date: 1995/08/21 Message-ID: <41a7v8$kpj@sheckley.cnam.fr>#1/1 X-Deja-AN: 108584099 distribution: world references: <4078vd$1sr@sheckley.cnam.fr> content-type: text/plain; charset=iso-8859-1 organization: Conservatoire National des Arts et Metiers mime-version: 1.0 newsgroups: comp.unix.osf.osf1 On Tuesday 8 August 95, at 8 h 58, the keyboard of bortzmeyer@cnam.fr (Stephane Bortzmeyer) wrote: > I'm experimenting with ping on an Alpha (DEC 3000/600S) with > OSF/1 2.0. Apparently, ping round-trip times are always > multiples of 0.977 ms (1 second / 1024...). I don't see the > same behaviour on Linux, for instance. > > Replacing gettimeofday by getclock, as suggested by the man > page apparently changes nothing. > > Does anyone know how to obtain a better time resolution (one > milli-second is clearly too long for an Alpha on Ethernet)? Well, as explained by Jeffrey Mogul and a few others, IP delivers packets when they arrive, not at discrete intervals. getclock changes nothing because it's just another library routine on the top of gettimeofday. According to Jeffrey Mogul, "Sooner or later, perhaps in the next major release, Digital UNIX [the new name of OSF/1] will sup- port microsecond resolution in gettimeofday()." (Linux already has it.) In the mean time, there exist an (unsupported) way to reach that pre- cision: directly read the program counter of the Alpha. Here is Jef- frey Mogul's code to do that: --------- readpcc.s ----------------- #define v0 $0 #define ra $26 #define sp $30 #define zero $31 .align 4 .globl ReadPCC .ent ReadPCC,0 ReadPCC: .frame sp,0,ra rpcc v0 # read the process cycle counter ret zero,(ra) .end ReadPCC --------- end of readpcc.s ----------------- To use it, you first calibrate the processor and then you use that routine to improve gettimeofday results. As far as I know, the full code is not redistributable but it's quite simple. I've used this improved gettimeofday in my traceroute Web page: http://web.cnam.fr/Network/traceroute.html which indicates the speeds of the various links encountered. Thanks to everybody and specially to Jeffrey Mogul , Eric Werme USG and Dave Cherkus . Stephane Bortzmeyer Conservatoire National des Arts et Metiers bortzmeyer@cnam.fr Laboratoire d'Informatique 292, rue Saint-Martin tel: +33 (1) 40 27 27 31 75141 Paris Cedex 03 fax: +33 (1) 40 27 27 72 France "C'est la nuit qu'il est beau de croire a la lumiere." E. Rostand