Received: from snow-white.ee.udel.edu by whimsy.udel.edu id aa16349;
          20 Mar 97 17:22 GMT
Received: (from juha@localhost)
	by samuraj.c3l.tyreso.se (8.8.5/8.8.5) id SAA17457;
	Thu, 20 Mar 1997 18:22:43 +0100
Date: Thu, 20 Mar 1997 18:22:43 +0100
From: Juha Sarlin <juha@c3l.tyreso.se>
Message-Id: <199703201722.SAA17457@samuraj.c3l.tyreso.se>
To: Mills@huey.udel.edu
CC: stenn@whimsy.udel.edu
Subject: Re: loopfilter fix

Your ntpsim calculates the time constant like this:

	tau = 1 << (poll - 2);

and ntp_loopfilter.c does:

	time_constant = min(peer->ppoll, sys_poll) - NTP_MINPOLL;

where NTP_MINPOLL is 4. To get similar PLL behaviour you would need to
change this calculation or the loop parameters CLOCK_PHASE and CLOCK_FREQ.

I'm currently using an xntpd with these changes, in addition to my
earlier changes:

*** xntpd/ntp_loopfilter.c.~1~	Fri Mar 13 01:18:06 1997
--- xntpd/ntp_loopfilter.c	Fri Feb 13 01:21:10 1997
***************
*** 197,201 ****
  		last_time = current_time;
  	interval = current_time - last_time;
! 	time_constant = min(peer->ppoll, sys_poll) - NTP_MINPOLL;
  	clock_adjust = 0;
  	offset = fp_offset->l_f;
--- 197,201 ----
  		last_time = current_time;
  	interval = current_time - last_time;
! 	time_constant = min(peer->ppoll, sys_poll) - NTP_MINPOLL + 2;
  	clock_adjust = 0;
  	offset = fp_offset->l_f;
***************
*** 430,434 ****
  	 */
  	} else {
! 		time_constant = NTP_MINDPOLL - NTP_MINPOLL;
  		stmp = (offset / interval) << 4;
  		if (stmp < 0)
--- 430,434 ----
  	 */
  	} else {
! 		time_constant = NTP_MINDPOLL - NTP_MINPOLL + 2;
  		stmp = (offset / interval) << 4;
  		if (stmp < 0)
