[ntp:questions] Re: Multicast TTL and FreeBSD trouble

Per Hedeland per at hedeland.org
Sun Aug 21 13:35:30 UTC 2005


In article <4307C5F8.8080208 at gis.net> mayer at gis.net (Danny Mayer) writes:
>Per Hedeland wrote:
>> 
>> No - I can verify the FreeBSD behaviour you're seeing, on FreeBSD
>> 5.3-RELEASE with the included ntpd (which calls itself 4.2.0-a) - tried
>> 1 => 32 and 3 => 96 (btw, if you give -v to tcpdump it will parse out
>> the ttl for you). But with a 4.1.1a version (tarball from ntp.org IIRC)
>> that I happened to have laying around, I get the configured ttl on the
>> wire (same FreeBSD). Are you testing the same ntp version on Linux and
>> FreeBSD?
>> 
>> Anyway, looking through the 4.2.0 sources, I see that it does indeed
>> apply a mapping to the ttl value, that amounts to multiplying by 32 by
>> default:
>> 
>> 	for (i = 0; i < MAX_TTL; i++) {
>> 		sys_ttl[i] = (u_char)((i * 256) / MAX_TTL);
>> 		sys_ttlmax = i;
>> 	}
>> 
>
>This is bizarre. I have no idea what it does or rather why. I'd need to 
>follow this code to understand what's happening.

If you view it only as the list of values used for the documented
purpose of the 'ttl' command it's not bizarre (though the defaults seem
absurdly high, given that a ttl of 64 is currently assumed to be plenty
enough to span the Internet) - applying it to the ttl option of the
'broadcast' command does indeed seem pretty bizarre though.

> This, however, would be 
>no different on Linux than FreeBSD. You should get the same numbers.

Yes, see above and the OP's followups - this mapping wasn't done in
4.1.1.

>> The ttl command is documented in the current html pages, but the fact
>> that its settings are applied to the ttl option of the broadcast command
>> is not (nor the consequence that the max value of the ttl option is 7 -
>> in fact it is claimed that the default is 127) - maybe it's a bug.
>
>Quite possibly.

Well, it's clearly intentional (including a check that the ttl option
isn't set higher than 7) - but it could still be a bug of course.

--Per Hedeland
per at hedeland.org




More information about the questions mailing list