ntpd multicast TTL

John Marshall john.marshall at riverwillow.com.au
Mon Mar 8 09:37:59 UTC 2010


On Sun, 07 Mar 2010, 16:19 +0000, Christian Weisgerber wrote:
> ntpd is a convenient source of multicast packets for testing purposes.
> When I add
> 
> broadcast 224.0.1.1
> 
> to my ntp.conf, ntpd sends a multicast packet with TTL 1 every 64
> seconds.  Just as expected.  However, when I explicitly specify the
> TTL as in
> 
> broadcast 224.0.1.1 ttl 1
> 
> it sends packets with TTL 32.  Trying a few other numbers confirms
> that it multiplies the specified TTL by 32.  That is not expected.
> (I also don't recall this happening the last time I tried it, but
> that may have been years ago.)
> 
> Is this simply a bug in ntpd?

No, it's just that the ntp's server configuration statements don't use
their ttl option to specify network ttl value, but as zero-based index
into ntp's ttl value array.  The default array is as you describe
[1,32,64,96,128,160,192,224] but can be overridden by the ttl
configuration statement.

So the following lines in your ntp.conf would result in your multicast
server transmitting packets with ttl=4.

  ttl 2 4 6 8
  broadcast 224.0.1.1 ttl 1

I tripped over this last year when experimenting with ntp multicast.
I had to resort to the source code to understand what was happening.
It is actually documented.

<http://www.eecis.udel.edu/~mills/ntp/html/miscopt.html#ttl>

-- 
John Marshall
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20100308/16f7f141/attachment.pgp


More information about the freebsd-stable mailing list