Need *very* small NTP-Server for Linux

  • Follow


Hello,

I need a really small NTP-Server. The "one for all" daemon "ntpd" 
which also is responsible to act as client and has very much 
configuration options is too big for me. Anything I need is something 
which "shares" the current time on the server via ntp for other 
clients. The time on the server is already accurate and doesn't need 
update.

Thank you very much in advance for any information

Yours

Manuel
0
Reply Manuel 9/17/2005 6:54:55 PM

ntp is not a traditional client/server model.  It is "participatory"
(sharing ideas of the time) as oposed to master/slave.

You can build ntpd with no refclocks and the footprint will be much
smaller.

The ntp distribution comes with an sntp client that may be useful for you on
your client machines; there is currently a bug in sntp that will be fixed
for the ntp-4.2.1 release, which I expect will be later this month.

I recommend you carefully examine and understand your operational
requirements; you may decide that you can use timed instead, or you may
decide you can use sntp, or you may need full ntp.

H
0
Reply Harlan 9/17/2005 7:08:54 PM


Harlan Stenn schrieb:
> You can build ntpd with no refclocks and the footprint will be much
> smaller.

Is there any documentation somewhere on which parts and configuration 
options will be removed if using this "no refclocks"?

> The ntp distribution comes with an sntp client that may be useful for you on
> your client machines; there is currently a bug in sntp that will be fixed
> for the ntp-4.2.1 release, which I expect will be later this month.

On the client machines I can also use ntpd. There is no problem with 
the size.

> I recommend you carefully examine and understand your operational
> requirements; you may decide that you can use timed instead, or you may
> decide you can use sntp, or you may need full ntp.

I want to run the server on a small box running embedded linux. I 
don't have many space there. The time on the box is accurate using 
other ways of synchronisation than NTP. Normally the time is only used 
internally, but I want to share the time via NTP to clients in my network.

I need a *very* small application which "takes" the current time on 
the system and "shares" this time via NTP. This application should not 
need any configuration file. I also need no command line interface 
(but if it's there this would be no problem). Just take time and share 
to everyone who is able to connect to the server. Anything should fit 
into one binary which I want to flash on the linux box.

CU

Manuel
0
Reply Manuel 9/17/2005 7:15:12 PM

Manuel Reimer wrote:
> Harlan Stenn schrieb:
> 
>> You can build ntpd with no refclocks and the footprint will be much
>> smaller.
> 
> 
> Is there any documentation somewhere on which parts and configuration 
> options will be removed if using this "no refclocks"?
> 
>> The ntp distribution comes with an sntp client that may be useful for 
>> you on
>> your client machines; there is currently a bug in sntp that will be fixed
>> for the ntp-4.2.1 release, which I expect will be later this month.
> 
> 
> On the client machines I can also use ntpd. There is no problem with the 
> size.
> 
>> I recommend you carefully examine and understand your operational
>> requirements; you may decide that you can use timed instead, or you may
>> decide you can use sntp, or you may need full ntp.
> 
> 
> I want to run the server on a small box running embedded linux. I don't 
> have many space there. The time on the box is accurate using other ways 
> of synchronisation than NTP. Normally the time is only used internally, 
> but I want to share the time via NTP to clients in my network.
> 
> I need a *very* small application which "takes" the current time on the 
> system and "shares" this time via NTP. This application should not need 
> any configuration file. I also need no command line interface (but if 
> it's there this would be no problem). Just take time and share to 
> everyone who is able to connect to the server. Anything should fit into 
> one binary which I want to flash on the linux box.

Is this in terms of disk space or memory? I did add an option to not 
build with IPv6 stack which *may* reduce the on-disk footprint, but most 
of this kind of thing is more effort than it's worth. I believe that you 
have to specifically specify refclocks if you want to use them, 
otherwise the default is not to build any of the refclock code.

Danny

> 
> CU
> 
> Manuel
> 
> _______________________________________________
> questions mailing list
> questions@lists.ntp.isc.org
> https://lists.ntp.isc.org/mailman/listinfo/questions
> 

_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
Reply mayer 9/18/2005 1:54:39 AM

Danny,

A bunch of refclocks are built by default.  Not the parse refclocks.
Some view this last bit as a bug, others as a feature.

H
0
Reply Harlan 9/18/2005 2:26:09 AM

>> You can build ntpd with no refclocks and the footprint will be much
>> smaller.

> Is there any documentation somewhere on which parts and configuration
> options will be removed if using this "no refclocks"?

I'm not sure.

If you build with "no refclocks" then no refclocks are built.

I suspect you will want --disable-all-clocks --enable-LOCAL-CLOCK, as
you will want this minimal-footprint ntpd to serve time based on the
local refclock.

H
0
Reply Harlan 9/18/2005 2:30:24 AM

In article <dghq67$q09$1@elvis.franken.de>,
Manuel Reimer <mreimer@despammed.com> wrote:

> I want to run the server on a small box running embedded linux. I 

You will need the local clock driver at the very least.

> don't have many space there. The time on the box is accurate using 

You might want to note that much of the apparent memory size of ntpd is
due to locking libc into memory.  If you are really space critical, you
should build a libc that doesn't have anything unnecessary in it, in
which case the marginal cost for ntpd will be quite small.

> other ways of synchronisation than NTP. Normally the time is only used 

In that case you will be duplicating a lot of the NTP clock filter and 
clock discipline code, or you will not have a high quality time.

> internally, but I want to share the time via NTP to clients in my network.

> I need a *very* small application which "takes" the current time on 
> the system and "shares" this time via NTP. This application should not 

It sound as though what you really need is a software equivalent of
the FPGA "SNTP" server discussed here last week.

> need any configuration file. I also need no command line interface 

You need an HCI to:

1) set the leap warning indicator;
2) mark the time invalid if your time source fails.

You will also need some means of delaying the start of the server until
your other time synchronisation mechanism has locked up properly.
0
Reply david 9/18/2005 9:36:17 AM

You may wish to download NetTime from  
http://sourceforge.net/projects/nettime.

thanks.

On Sun, 18 Sep 2005 02:54:55 +0800, Manuel Reimer <mreimer@despammed.com>  
wrote:

> Hello,
>
> I need a really small NTP-Server. The "one for all" daemon "ntpd" which  
> also is responsible to act as client and has very much configuration  
> options is too big for me. Anything I need is something which "shares"  
> the current time on the server via ntp for other clients. The time on  
> the server is already accurate and doesn't need update.
>
> Thank you very much in advance for any information
>
> Yours
>
> Manuel



-- 
Kuala Lumpur
MALAYSIA : UTC +08:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
0
Reply Johnson 9/18/2005 2:05:44 PM

Johnson Luqaz wrote:
> You may wish to download NetTime from  
> http://sourceforge.net/projects/nettime.
> 

I doubt it. He's talking about Unix and anyway that's a SNTP client and 
not a server and he needs NTP. It's nettime is not even RFC 2030 compliant.

Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
Reply mayer 9/19/2005 10:00:49 PM

Danny Mayer wrote:

> Johnson Luqaz wrote:
> 
>> You may wish to download NetTime from 
>> http://sourceforge.net/projects/nettime.
>>
> 
> I doubt it. He's talking about Unix and anyway that's a SNTP client and
> not a server and he needs NTP. It's nettime is not even RFC 2030 compliant.

Writing a really tiny (S)NTP server should be a fun exercise, as long as
you can make the following (extremely) simplifying assumptions:

a) The local system clock is always correct

b) All time stamps can be assumed to be correct.

c) No need to support either authentication or any form of ntpq/ntpdc
queries.

Under these assumptions you can reduce the code to something like this:

open socket 123

while (1) {
  retrieve ntp request packet
  T = query system time
  set T2, T3 and reference time = T
  update leap pending and any other required flags
  (In particular, set the stratum to a high value, like 8-10!)
  return the ntp packet to the requesting client.
}

I.e. it should be possible to reduce the code to less than 1 KB as long
as the socket library code is already resident.

Terje
-- 
- <Terje.Mathisen@hda.hydro.com>
"almost all programming can be viewed as an exercise in caching"
0
Reply Terje 9/20/2005 7:55:23 AM

Terje Mathisen schrieb:
> Writing a really tiny (S)NTP server should be a fun exercise, as long as
> you can make the following (extremely) simplifying assumptions:
> 
> a) The local system clock is always correct

I start the "simple ntp daemon" as soon as the other timesource is 
alive. As soon as this is true the time is almost correct. If it isn't 
correct for one or two milliseconds, then this is no problem for me.

> b) All time stamps can be assumed to be correct.

Time stamps?

> c) No need to support either authentication or any form of ntpq/ntpdc
> queries.

I just want to publish the time of the clock on the "embedded linux 
box" to everyone who is able to connect to the box on the 
LAN-Interface where the "simple ntp daemon" is listening. I don't want 
anything more. People aren't allowed to do anything on that box. They 
are only allowed to sync their time.

> Under these assumptions you can reduce the code to something like this:

I also tried to start searching the basic information for writing 
something on my own, but I couldn't find any good documentation of the 
NTP-protocol (the RFC seems to be to difficult for me, especially as 
I'm german...). I tried to just "telnet" to the port 123 of any 
NTP-server to be at least able to see how the response looks like, but 
I didn't receive any response using telnet. Telnet just told me that 
it isn't able to connect.

> I.e. it should be possible to reduce the code to less than 1 KB as long
> as the socket library code is already resident.

I never developed network applications so far for unix, but if I find 
out how this NTP-protocol works I'm sure I'll find tutorials about 
unix socket programming using any search engine.

CU

Manuel
0
Reply Manuel 9/20/2005 5:42:40 PM

At 7:42 PM +0200 2005-09-20, Manuel Reimer wrote:

>  I also tried to start searching the basic information for writing
>  something on my own, but I couldn't find any good documentation of
>  the NTP-protocol (the RFC seems to be to difficult for me, especially
>  as I'm german...). I tried to just "telnet" to the port 123 of any
>  NTP-server to be at least able to see how the response looks like,
>  but I didn't receive any response using telnet. Telnet just told me
>  that it isn't able to connect.

	If you're going to try to write your own code for this, then you 
can't get around reading the RFC.  For one thing, had you read the 
RFC, it should have been obvious that NTP is inherently a UDP-only 
protocol, and does not use TCP.  Any attempt to use TCP for a 
time-sensitive protocol like NTP would totally destroy the accuracy 
of the time you're trying to serve to your clients.

	If you're unable to read the RFC, then I can't imagine that you 
could possibly write code that would implement the smallest possible 
subset of the NTP protocol.  Try running the "msntp" server, or 
something else.

-- 
Brad Knowles, <brad@stop.mail-abuse.org>

"Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety."

     -- Benjamin Franklin (1706-1790), reply of the Pennsylvania
     Assembly to the Governor, November 11, 1755

   SAGE member since 1995.  See <http://www.sage.org/> for more info.
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
Reply brad 9/20/2005 8:03:25 PM

Manuel Reimer wrote:
> 
> I also tried to start searching the basic information for writing 
> something on my own, but I couldn't find any good documentation of the 
> NTP-protocol (the RFC seems to be to difficult for me, especially as I'm 
> german...). I tried to just "telnet" to the port 123 of any NTP-server 
> to be at least able to see how the response looks like, but I didn't 
> receive any response using telnet. Telnet just told me that it isn't 
> able to connect.
> 
You can't telnet to the NTP port, it's a UDP protocol. You should use 
ntpq for querying the server.

Danny
_______________________________________________
questions mailing list
questions@lists.ntp.isc.org
https://lists.ntp.isc.org/mailman/listinfo/questions

0
Reply mayer 9/20/2005 10:14:39 PM

12 Replies
466 Views

(page loaded in 0.129 seconds)

Similiar Articles:


















7/25/2012 10:52:10 AM


Reply: