Definition

time-to-live (TTL)

Contributor(s): John Burke

Time-to-live has three interpretations in computing:

  • The time for which a DNS record can be returned from cache
  • The time for which Web content can be returned from cache
  • As a control on the age of packets in an Internet Protocol or Multiprotocol Label Switching (MPLS) network

DNS TTL is a numerical value, set in a DNS record on the authoritative DNS server for the domain, defining the number of seconds for which a caching server can provide its cached value for the record. When that many seconds have elapsed since the last refresh, the caching server will reach out to the authoritative server again and receive the current (and possibly changed) value for the record.

In HTTP, the TTL is, again, the number of seconds for which cached information can be returned before the Web server is required to check again that it is still "fresh." A default value is defined by settings on the Web server, but can be overridden by cache-control tags (which define which kinds of servers, if any, can cache the data) or expires tags (which define a date and time at which the content is stale) in HTML page headers.

In IP and MPLS networks, a TTL field in each packet (renamed the hop limit in IPv6) tells each router that handles the packet whether to forward or discard it. An IP TTL is set initially by the system sending the packet. It can be set to any value between 1 and 255; different operating systems set different defaults. Each router that receives the packet subtracts at least 1 from the count; if the count remains greater than 0, the router forwards the packet, otherwise it discards it and sends an Internet Control Message Protocol (ICMP) message back to the originating host, which may trigger a resend. The point of the TTL/hop limit is to keep streams of undeliverable packets stuck in routing loops (e.g., due to incorrect routing tables) from circulating forever and clogging up the networks in question. In MPLS clouds, the MPLS TTL is copied from the IP TTL when the IP packet enters the cloud. On egress, the MPLS TTL value is copied into the IP TTL field (as long as it is less than the value in the field).

CCNA ICND2 TTL values
Time-to-live ping detail

The ping and the traceroute utilities both make use of the TTL value to attempt to reach a given host computer or to trace a route to that host. Traceroute sends a stream of packets with successively higher TTLs so each will be discarded in turn by the next hop (router) on the route to the destination: The first packet has a TTL of one and is discarded by the first router, the second has a TTL of two and is discarded by the next router, and so on. The time between sending the packet and receiving back the ICMP message that it was discarded is used to calculate each successive hop travel time.

In IP multicast, the TTL controls the scope or range in which a packet may be forwarded. By convention:

  • 0 is restricted to the same host
  • 1 is restricted to the same subnet
  • 32 is restricted to the same site
  • 64 is restricted to the same region
  • 128 is restricted to the same continent
  • 255 is unrestricted
This was first published in November 2015

Continue Reading About time-to-live (TTL)

Dig Deeper on IP Networking

PRO+

Content

Find more PRO+ content and other member only offers, here.

Related Discussions

Margaret Rouse asks:

What benefit can you see in setting any TTL to a small value?

1  Response So Far

Join the Discussion

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

File Extensions and File Formats

Powered by:

SearchSDN

SearchEnterpriseWAN

SearchUnifiedCommunications

SearchMobileComputing

SearchDataCenter

SearchITChannel

Close