[net.lan] Time to live values for IP networks.

martin@sabre.UUCP (Martin Levy) (02/28/85)

I'm looking for infomation about the correct values for the Time to
live (TTL) in the IP world.
We have constructed a network with 4.2 machines as gateways, both Vaxen
and Sun's, soon to replaced with real gateway machines. The problem is
to do with the initial value of the TTL field and the amount you should
decrement it by when passing thru a Gateway. The 4.2 code is ment to run
as a gateway, but these are the defines and code for dealing with TTL.

$ grep TTL /sys/netinet/ip.h:
#define	MAXTTL		255		/* maximum time to live (seconds) */
#define	IPTTLDEC	1		/* subtracted when forwarding */

$ grep TTL /sys/netinet/tcp_timer.h:
#define	TCP_TTL		15		/* time to live for TCP segs */

$ cat /sys/netinet/ip_output.c
...
	if (ip->ip_ttl < IPTTLDEC) {
		type = ICMP_TIMXCEED, code = ICMP_TIMXCEED_INTRANS;
		goto sendicmp;
	}
	ip->ip_ttl -= IPTTLDEC;
...

$ cat /sys/netinet/tcp_output.c:
...
	((struct ip *)ti)->ip_ttl = TCP_TTL;

$ cat /sys/netinet/tcp_subr.c:
...
	((struct ip *)ti)->ip_ttl = TCP_TTL;

$ cat /sys/netinet/udp_usrreq.c:
...
	((struct ip *)ui)->ip_ttl = MAXTTL;

As you can see the ip_ttl field is set to two different values for UDP
or TCP. the decrement values are in ip_input, and it's set to 15.

whats should the correct vaules be, should UDP and TCP packets have the
same start values?

what are the values used in other network protocols.

martin.